﻿<%@ Page Language="C#"  EnableEventValidation = "false" AutoEventWireup="true" CodeBehind="Ticket.aspx.cs" Inherits="StreetSmartAdmin.Ticket" %>
<%@ Register TagPrefix="CustUserCtrl" TagName="Header" Src="Header.ascx" %>
<%@ Register TagPrefix="CustUserCtrl" TagName="Footer" Src="Footer.ascx" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<script language="javascript" type="text/javascript" src="WdatePicker.js"></script>
<head runat="server">
    <title></title>
    <link type="text/css" rel="stylesheet" href="style.css" />
</head>
<body>
    <form id="form1" runat="server" enctype="multipart/form-data">
        <CustUserCtrl:Header ID="Header" runat="server"></CustUserCtrl:Header>
    <div class="mGrid">
    <center>
        <h1>Customer Feedback</h1>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:SQLServer2005DBConnectionString %>" 
            SelectCommand="SELECT * FROM [tblTicket] WHERE (([FEED_SOLVED] like @FEED_SOLVED) AND ([FEED_TYPE] like @FEED_TYPE) AND ([FEED_DEPART] like @FEED_DEPART) AND ([FEED_PARTNER] like @FEED_PARTNER) AND ([FEED_PRIORITY] like @FEED_PRIORITY) AND ([FEED_ASSIGN] like @FEED_ASSIGN) AND ([REGI_DATE] &gt;= @REGI_DATE) AND ([REGI_DATE] &lt;= @REGI_DATE2)) ORDER BY [CFID] DESC" 
            OldValuesParameterFormatString="original_{0}" 
            DeleteCommand="DELETE FROM [tblTicket] WHERE [CFID] = @original_CFID" 
            InsertCommand="INSERT INTO [tblTicket] ([REGI_DATE], [LOG_BY], [ID_TYPE], [USERID], [COMPANY_NAME], [TITLE], [FIRSTNAME], [LASTNAME], [EMAIL], [PHONE], [MOBILE], [FAX], [ADDRESS], [SUBURB], [STATE], [POSTCODE], [OMEN_HAS], [OMEN_ID], [FEED_TYPE], [FEED_PRIORITY], [FEED_SOURCE], [FEED_ISSUE], [FEED_SUBJECT], [FEED_DEPART], [FEED_PARTNER], [FEED_SOLVED], [FEED_SOLVED_DATE], [FEED_ESCALATE], [FEED_ESCALATE_DATE], [FEED_ASSIGN]) VALUES (@REGI_DATE, @LOG_BY, @ID_TYPE, @USERID, @COMPANY_NAME, @TITLE, @FIRSTNAME, @LASTNAME, @EMAIL, @PHONE, @MOBILE, @FAX, @ADDRESS, @SUBURB, @STATE, @POSTCODE, @OMEN_HAS, @OMEN_ID, @FEED_TYPE, @FEED_PRIORITY, @FEED_SOURCE, @FEED_ISSUE, @FEED_SUBJECT, @FEED_DEPART, @FEED_PARTNER, @FEED_SOLVED, @FEED_SOLVED_DATE, @FEED_ESCALATE, @FEED_ESCALATE_DATE, @FEED_ASSIGN)" 
            UpdateCommand="UPDATE [tblTicket] SET [REGI_DATE] = @REGI_DATE, [LOG_BY] = @LOG_BY, [ID_TYPE] = @ID_TYPE, [USERID] = @USERID, [COMPANY_NAME] = @COMPANY_NAME, [TITLE] = @TITLE, [FIRSTNAME] = @FIRSTNAME, [LASTNAME] = @LASTNAME, [EMAIL] = @EMAIL, [PHONE] = @PHONE, [MOBILE] = @MOBILE, [FAX] = @FAX, [ADDRESS] = @ADDRESS, [SUBURB] = @SUBURB, [STATE] = @STATE, [POSTCODE] = @POSTCODE, [OMEN_HAS] = @OMEN_HAS, [OMEN_ID] = @OMEN_ID, [FEED_TYPE] = @FEED_TYPE, [FEED_PRIORITY] = @FEED_PRIORITY, [FEED_SOURCE] = @FEED_SOURCE, [FEED_ISSUE] = @FEED_ISSUE, [FEED_SUBJECT] = @FEED_SUBJECT, [FEED_DEPART] = @FEED_DEPART, [FEED_PARTNER] = @FEED_PARTNER, [FEED_SOLVED] = @FEED_SOLVED, [FEED_SOLVED_DATE] = @FEED_SOLVED_DATE, [FEED_ESCALATE] = @FEED_ESCALATE, [FEED_ESCALATE_DATE] = @FEED_ESCALATE_DATE, [FEED_ASSIGN] = @FEED_ASSIGN WHERE [CFID] = @original_CFID"

            filterexpression="(COMPANY_NAME LIKE '%{0}%' or FIRSTNAME  LIKE '%{0}%' or LASTNAME LIKE '%{0}%'  or EMAIL  LIKE '%{0}%')">
          
            <filterparameters>
                <asp:controlparameter controlid="searchBox" propertyname="Text" />
                <asp:controlparameter controlid="fromdate" DefaultValue="1983-01-01" Name="Data1" PropertyName="Text"
                    Type="DateTime" />

                
            </filterparameters>

            <DeleteParameters>
                <asp:Parameter Name="original_CFID" Type="Int32" />
            </DeleteParameters>
            <InsertParameters>
                <asp:Parameter Name="REGI_DATE" Type="DateTime" />
                <asp:Parameter Name="LOG_BY" Type="String" />
                <asp:Parameter Name="ID_TYPE" Type="String" />
                <asp:Parameter Name="USERID" Type="String" />
                <asp:Parameter Name="COMPANY_NAME" Type="String" />
                <asp:Parameter Name="TITLE" Type="String" />
                <asp:Parameter Name="FIRSTNAME" Type="String" />
                <asp:Parameter Name="LASTNAME" Type="String" />
                <asp:Parameter Name="EMAIL" Type="String" />
                <asp:Parameter Name="PHONE" Type="String" />
                <asp:Parameter Name="MOBILE" Type="String" />
                <asp:Parameter Name="FAX" Type="String" />
                <asp:Parameter Name="ADDRESS" Type="String" />
                <asp:Parameter Name="SUBURB" Type="String" />
                <asp:Parameter Name="STATE" Type="String" />
                <asp:Parameter Name="POSTCODE" Type="String" />
                <asp:Parameter Name="OMEN_HAS" Type="String" />
                <asp:Parameter Name="OMEN_ID" Type="String" />
                <asp:Parameter Name="FEED_TYPE" Type="String" />
                <asp:Parameter Name="FEED_PRIORITY" Type="String" />
                <asp:Parameter Name="FEED_SOURCE" Type="String" />
                <asp:Parameter Name="FEED_ISSUE" Type="String" />
                <asp:Parameter Name="FEED_SUBJECT" Type="String" />
                <asp:Parameter Name="FEED_DEPART" Type="String" />
                <asp:Parameter Name="FEED_PARTNER" Type="String" />
                <asp:Parameter Name="FEED_SOLVED" Type="String" />
                <asp:Parameter Name="FEED_SOLVED_DATE" Type="DateTime" />
                <asp:Parameter Name="FEED_ESCALATE" Type="String" />
                <asp:Parameter Name="FEED_ESCALATE_DATE" Type="DateTime" />
                <asp:Parameter Name="FEED_ASSIGN" Type="String" />
            </InsertParameters>

            <SelectParameters>
                <asp:ControlParameter ControlID="ddlsearch_res" Name="FEED_SOLVED" 
                    PropertyName="SelectedValue" Type="String" />

                <asp:ControlParameter ControlID="ddlsearch_typ" Name="FEED_TYPE" 
                    PropertyName="SelectedValue" Type="String" />
                <asp:ControlParameter ControlID="ddlsearch_dep" Name="FEED_DEPART" 
                    PropertyName="SelectedValue" Type="String" />
                <asp:ControlParameter ControlID="ddlsearch_par" Name="FEED_PARTNER" 
                    PropertyName="SelectedValue" Type="String" />
                <asp:ControlParameter ControlID="ddlsearch_pri" Name="FEED_PRIORITY" 
                    PropertyName="SelectedValue" Type="String" />
                <asp:ControlParameter ControlID="ddlsearch_ass" Name="FEED_ASSIGN" 
                    PropertyName="SelectedValue" Type="String" />
                <asp:ControlParameter ControlID="fromdate" Name="REGI_DATE" PropertyName="Text"  DefaultValue="2000-10-30"
                    Type="DateTime" />
                <asp:ControlParameter ControlID="todate" Name="REGI_DATE2" DefaultValue="2022-10-30"
                    PropertyName="Text" Type="DateTime" />
            </SelectParameters>
            <UpdateParameters>
                <asp:Parameter Name="REGI_DATE" Type="DateTime" />
                <asp:Parameter Name="LOG_BY" Type="String" />
                <asp:Parameter Name="ID_TYPE" Type="String" />
                <asp:Parameter Name="USERID" Type="String" />
                <asp:Parameter Name="COMPANY_NAME" Type="String" />
                <asp:Parameter Name="TITLE" Type="String" />
                <asp:Parameter Name="FIRSTNAME" Type="String" />
                <asp:Parameter Name="LASTNAME" Type="String" />
                <asp:Parameter Name="EMAIL" Type="String" />
                <asp:Parameter Name="PHONE" Type="String" />
                <asp:Parameter Name="MOBILE" Type="String" />
                <asp:Parameter Name="FAX" Type="String" />
                <asp:Parameter Name="ADDRESS" Type="String" />
                <asp:Parameter Name="SUBURB" Type="String" />
                <asp:Parameter Name="STATE" Type="String" />
                <asp:Parameter Name="POSTCODE" Type="String" />
                <asp:Parameter Name="OMEN_HAS" Type="String" />
                <asp:Parameter Name="OMEN_ID" Type="String" />
                <asp:Parameter Name="FEED_TYPE" Type="String" />
                <asp:Parameter Name="FEED_PRIORITY" Type="String" />
                <asp:Parameter Name="FEED_SOURCE" Type="String" />
                <asp:Parameter Name="FEED_ISSUE" Type="String" />
                <asp:Parameter Name="FEED_SUBJECT" Type="String" />
                <asp:Parameter Name="FEED_DEPART" Type="String" />
                <asp:Parameter Name="FEED_PARTNER" Type="String" />
                <asp:Parameter Name="FEED_SOLVED" Type="String" />
                <asp:Parameter Name="FEED_SOLVED_DATE" Type="DateTime" />
                <asp:Parameter Name="FEED_ESCALATE" Type="String" />
                <asp:Parameter Name="FEED_ESCALATE_DATE" Type="DateTime" />
                <asp:Parameter Name="FEED_ASSIGN" Type="String" />
                <asp:Parameter Name="original_CFID" Type="Int32" />
            </UpdateParameters>
        </asp:SqlDataSource>





        <asp:Panel ID="panSearch" runat="server" DefaultButton="btnsearch" Width="100%" >
                Date From:<asp:TextBox ID="fromdate" runat="server"   onclick="WdatePicker({maxDate:'%y-%M-%d',startDate:'%y-%M-%d'})"></asp:TextBox>
                To:<asp:TextBox ID="todate" runat="server"  onclick="WdatePicker({maxDate:'%y-%M-%d',startDate:'%y-%M-%d'})"></asp:TextBox>

                
                
                <asp:DropDownList ID="ddlsearch_typ" runat="server">
                    <asp:ListItem Value="%">Type:All</asp:ListItem>
                    <asp:ListItem>Complaint</asp:ListItem>
                    <asp:ListItem>Compliment</asp:ListItem>
                    <asp:ListItem>General Feedback</asp:ListItem>
                </asp:DropDownList>
                <asp:DropDownList ID="ddlsearch_res" runat="server">
                    <asp:ListItem Value="%">Status:All</asp:ListItem>
                    <asp:ListItem>resolved</asp:ListItem>
                    <asp:ListItem>unresolved</asp:ListItem>
                </asp:DropDownList>
                <asp:DropDownList ID="ddlsearch_pri" runat="server" Visible="false">
                    <asp:ListItem Value="%">Priority:All</asp:ListItem>
                    <asp:ListItem>Low</asp:ListItem>
                    <asp:ListItem>Medium</asp:ListItem>
                    <asp:ListItem>High</asp:ListItem>
                    <asp:ListItem>Extreme</asp:ListItem>
                </asp:DropDownList>
                <asp:DropDownList ID="ddlsearch_dep" runat="server" Visible="false">
                    <asp:ListItem Value="%">Department:All</asp:ListItem>
                    <asp:ListItem>Sydney Office</asp:ListItem>
                    <asp:ListItem>TeleFields</asp:ListItem>
                    <asp:ListItem>Manila</asp:ListItem>
                </asp:DropDownList>

                <asp:DropDownList ID="ddlsearch_par" runat="server">
                    <asp:ListItem Value="%">Partner:All</asp:ListItem>
                  
                    <asp:ListItem>Energy Australia</asp:ListItem>
                    <asp:ListItem>BlueNRG</asp:ListItem>
                    <asp:ListItem>ERMPower</asp:ListItem>
                    <asp:ListItem>Alinta Energy</asp:ListItem>
                    <asp:ListItem>Sydney Office</asp:ListItem>
                    <asp:ListItem>TeleFields</asp:ListItem>
                    <asp:ListItem>Manila</asp:ListItem>
                </asp:DropDownList>
                <asp:DropDownList ID="ddlsearch_ass" runat="server">
                    <asp:ListItem Value="%">Assign To:All</asp:ListItem>
                    <asp:ListItem>Samantha Davies</asp:ListItem>
                    <asp:ListItem>Kelvin Wiggins</asp:ListItem>
                    <asp:ListItem>Daven Bettridge</asp:ListItem>
                    <asp:ListItem>Orson Gilmore</asp:ListItem>
                                        <asp:ListItem>Vic Sandhu</asp:ListItem>
                                        <asp:ListItem>Sales Won</asp:ListItem>
                </asp:DropDownList>
                Filter by Email/First/Last/CompanyName:
                <ASP:TextBox runat="server" type="text" id="searchBox" Width="250px"/>
                <asp:Button ID="btnsearch" runat="server" Text="Search" />
                
                
        </asp:Panel> 
        <asp:Button ID="Button1" runat="server" Text="Add New Record" OnClick="btnAddRecord_click"/>
        <asp:Label ID="PageSize" runat="server" Text="Page size: "></asp:Label>
        <asp:DropDownList ID="ddlpage" runat="server" AutoPostBack="True">
            <asp:ListItem Selected="True">10</asp:ListItem>
            <asp:ListItem>20</asp:ListItem>
            <asp:ListItem>50</asp:ListItem>
            <asp:ListItem>100</asp:ListItem>
        </asp:DropDownList>
        <asp:Label ID="Message" runat="server" Text=""></asp:Label>
        <asp:Button ID="export" runat="server" Text="Export" OnClick="export_Click"/>
        <asp:GridView ID="GridView1" runat="server" CssClass="mGrid" 
            PagerStyle-CssClass="pgr" AlternatingRowStyle-CssClass="alt" 
            DataSourceID="SqlDataSource1" AutoGenerateColumns="False" 
            DataKeyNames="CFID" AllowPaging="True" AllowSorting="True"
            OnRowDeleting="GridView1_RowDeleting"
            EnableModelValidation="True">
            <AlternatingRowStyle CssClass="alt"></AlternatingRowStyle>
            <Columns>
                <asp:TemplateField ShowHeader="False">
                    <ItemTemplate>
                        <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" 
                            CommandName="Select" Text="Select"></asp:LinkButton>

                    </ItemTemplate>
                </asp:TemplateField>

                <asp:TemplateField HeaderText="Customer" SortExpression="FIRSTNAME">
                    <ItemTemplate>
                        <asp:Label ID="FIRSTNAME" runat="server" Text='<%# Bind("FIRSTNAME") %>'></asp:Label>
                         &nbsp; 
                         <asp:Label ID="LASTNAME" runat="server" Text='<%# Bind("LASTNAME") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>

                <asp:BoundField DataField="LOG_BY" HeaderText="LOG_BY" 
                    SortExpression="LOG_BY"  Visible="false"/>

                <asp:TemplateField HeaderText="Company" SortExpression="COMPANY_NAME">
                    <ItemTemplate>
                        <asp:Label ID="COMPANY_NAME" runat="server" Text='<%# Bind("COMPANY_NAME") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                
                <asp:TemplateField HeaderText="Phone" SortExpression="PHONE">
                    <ItemTemplate>
                   
                         <asp:Label ID="PHONE" runat="server" Text='<%# Bind("PHONE") %>'></asp:Label>
                          <br />
                         <asp:Label ID="MOBILE" runat="server" Text='<%# Bind("MOBILE") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>

                <asp:TemplateField HeaderText="Address">
                    <ItemTemplate>
                   
                         <asp:Label ID="ADDRESS" runat="server" Text='<%# Bind("ADDRESS") %>'></asp:Label>
                         &nbsp;
                         <asp:Label ID="SUBURB" runat="server" Text='<%# Bind("SUBURB") %>'></asp:Label>
                         &nbsp;
                         <asp:Label ID="STATE" runat="server" Text='<%# Bind("STATE") %>'></asp:Label>
                         &nbsp;
                         <asp:Label ID="POSTCODE" runat="server" Text='<%# Bind("POSTCODE") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="CFID" HeaderText="CFID" InsertVisible="False" 
                    ReadOnly="True" SortExpression="CFID"   Visible="false"/>

                <asp:BoundField DataField="FEED_TYPE" HeaderText="Type" 
                    SortExpression="FEED_TYPE"   Visible="false"/>
                <asp:BoundField DataField="FEED_SOLVED" HeaderText="Status" 
                    SortExpression="FEED_SOLVED" />
                <asp:BoundField DataField="FEED_PRIORITY" HeaderText="Priority" 
                    SortExpression="FEED_PRIORITY"  Visible="false" />
                <asp:BoundField DataField="FEED_ISSUE" HeaderText="Issue" 
                    SortExpression="FEED_ISSUE" />
                <asp:BoundField DataField="FEED_SUBJECT" HeaderText="Subject" 
                    SortExpression="FEED_SUBJECT"  Visible="false"/>
                <asp:TemplateField HeaderText="Department" SortExpression="FEED_DEPART" Visible="false" >
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("FEED_DEPART") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                       
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Partner" SortExpression="FEED_PARTNER">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("FEED_PARTNER") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                   
                        <asp:Label ID="FEED_PARTNER" runat="server" Text='<%# Bind("FEED_PARTNER") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="ID_TYPE" HeaderText="ID_TYPE" 
                    SortExpression="ID_TYPE" Visible="False"/>
                <asp:BoundField DataField="USERID" HeaderText="USERID" 
                    SortExpression="USERID"  Visible="false"/>


                <asp:TemplateField HeaderText="ProductType & SourceCode (For existing client)">
                    <ItemTemplate>
                        <asp:Label ID="lblUSERID" runat="server" Text='<%# Bind("USERID") %>' 
                            Visible="False"></asp:Label>
                        <asp:SqlDataSource ID="SqlDataSource18" runat="server" 
                            ConnectionString="<%$ ConnectionStrings:SQLServer2005DBConnectionString %>" 
                            SelectCommand="SELECT [DateConverted], [ProductType], [SourceCode], [NMI], [MIRN] FROM [tblUser] WHERE ([UserID] = @UserID)">
                            <SelectParameters>
                                <asp:ControlParameter ControlID="lblUSERID" Name="UserID" PropertyName="Text" 
                                    Type="Int32" />
                            </SelectParameters>
                        </asp:SqlDataSource>
                        <asp:GridView ID="GridView7" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource18"
                            EnableModelValidation="True" ShowHeader="False" BorderWidth="0px">
                            <Columns>
                                <asp:TemplateField ShowHeader="False">
                                    <ItemTemplate>
                                        <asp:Label ID="ProductTypeLabel" runat="server" Text='<%# Bind("ProductType") %>' />
                                        &nbsp;&nbsp;
                                        <asp:Label ID="SourceCodeLabel" runat="server" Text='<%# Bind("SourceCode") %>' />
                                        <br />
                                        Converted on:
                                        <asp:Label ID="DateConvertedLabel" runat="server" Text='<%# Bind("DateConverted") %>' />
                                        &nbsp; NMI:
                                        <asp:Label ID="NMILabel" runat="server" Text='<%# Bind("NMI") %>' />
                                        &nbsp; MIRN:
                                        <asp:Label ID="MIRNLabel" runat="server" Text='<%# Bind("MIRN") %>' />
                                        <br />
                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                        </asp:GridView>
                    </ItemTemplate>
                </asp:TemplateField>


                <asp:BoundField DataField="EMAIL" HeaderText="EMAIL" 
                    SortExpression="EMAIL" Visible="False" />

                
                <asp:BoundField DataField="REGI_DATE" HeaderText="REGI_DATE" 
                    SortExpression="REGI_DATE"/>
                
                <asp:BoundField DataField="FEED_ASSIGN" HeaderText="FEED_ASSIGN" 
                    SortExpression="FEED_ASSIGN"   Visible="false"/>

            </Columns>

            <PagerStyle CssClass="pgr"></PagerStyle>
        </asp:GridView>
        </center>
        <br/>
        <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
            ConflictDetection="CompareAllValues" 
            ConnectionString="<%$ ConnectionStrings:SQLServer2005DBConnectionString %>" 
            DeleteCommand="DELETE FROM [tblTicket] WHERE [CFID] = @original_CFID AND (([REGI_DATE] = @original_REGI_DATE) OR ([REGI_DATE] IS NULL AND @original_REGI_DATE IS NULL)) AND (([LOG_BY] = @original_LOG_BY) OR ([LOG_BY] IS NULL AND @original_LOG_BY IS NULL)) AND (([ID_TYPE] = @original_ID_TYPE) OR ([ID_TYPE] IS NULL AND @original_ID_TYPE IS NULL)) AND (([USERID] = @original_USERID) OR ([USERID] IS NULL AND @original_USERID IS NULL)) AND (([COMPANY_NAME] = @original_COMPANY_NAME) OR ([COMPANY_NAME] IS NULL AND @original_COMPANY_NAME IS NULL)) AND (([FIRSTNAME] = @original_FIRSTNAME) OR ([FIRSTNAME] IS NULL AND @original_FIRSTNAME IS NULL))AND (([TITLE] = @original_TITLE) OR ([TITLE] IS NULL AND @original_TITLE IS NULL)) AND (([LASTNAME] = @original_LASTNAME) OR ([LASTNAME] IS NULL AND @original_LASTNAME IS NULL)) AND (([EMAIL] = @original_EMAIL) OR ([EMAIL] IS NULL AND @original_EMAIL IS NULL)) AND (([PHONE] = @original_PHONE) OR ([PHONE] IS NULL AND @original_PHONE IS NULL)) AND (([MOBILE] = @original_MOBILE) OR ([MOBILE] IS NULL AND @original_MOBILE IS NULL)) AND (([FAX] = @original_FAX) OR ([FAX] IS NULL AND @original_FAX IS NULL)) AND (([ADDRESS] = @original_ADDRESS) OR ([ADDRESS] IS NULL AND @original_ADDRESS IS NULL)) AND (([SUBURB] = @original_SUBURB) OR ([SUBURB] IS NULL AND @original_SUBURB IS NULL)) AND (([STATE] = @original_STATE) OR ([STATE] IS NULL AND @original_STATE IS NULL)) AND (([POSTCODE] = @original_POSTCODE) OR ([POSTCODE] IS NULL AND @original_POSTCODE IS NULL)) AND (([OMEN_HAS] = @original_OMEN_HAS) OR ([OMEN_HAS] IS NULL AND @original_OMEN_HAS IS NULL)) AND (([OMEN_ID] = @original_OMEN_ID) OR ([OMEN_ID] IS NULL AND @original_OMEN_ID IS NULL)) AND (([FEED_TYPE] = @original_FEED_TYPE) OR ([FEED_TYPE] IS NULL AND @original_FEED_TYPE IS NULL)) AND (([FEED_PRIORITY] = @original_FEED_PRIORITY) OR ([FEED_PRIORITY] IS NULL AND @original_FEED_PRIORITY IS NULL)) AND (([FEED_SOURCE] = @original_FEED_SOURCE) OR ([FEED_SOURCE] IS NULL AND @original_FEED_SOURCE IS NULL)) AND (([FEED_ISSUE] = @original_FEED_ISSUE) OR ([FEED_ISSUE] IS NULL AND @original_FEED_ISSUE IS NULL)) AND (([FEED_SUBJECT] = @original_FEED_SUBJECT) OR ([FEED_SUBJECT] IS NULL AND @original_FEED_SUBJECT IS NULL)) AND (([FEED_DEPART] = @original_FEED_DEPART) OR ([FEED_DEPART] IS NULL AND @original_FEED_DEPART IS NULL)) AND (([FEED_PARTNER] = @original_FEED_PARTNER) OR ([FEED_PARTNER] IS NULL AND @original_FEED_PARTNER IS NULL)) AND (([FEED_SOLVED] = @original_FEED_SOLVED) OR ([FEED_SOLVED] IS NULL AND @original_FEED_SOLVED IS NULL)) AND (([FEED_SOLVED_DATE] = @original_FEED_SOLVED_DATE) OR ([FEED_SOLVED_DATE] IS NULL AND @original_FEED_SOLVED_DATE IS NULL)) AND (([FEED_ESCALATE] = @original_FEED_ESCALATE) OR ([FEED_ESCALATE] IS NULL AND @original_FEED_ESCALATE IS NULL)) AND (([FEED_ESCALATE_DATE] = @original_FEED_ESCALATE_DATE) OR ([FEED_ESCALATE_DATE] IS NULL AND @original_FEED_ESCALATE_DATE IS NULL)) AND (([FEED_ASSIGN] = @original_FEED_ASSIGN) OR ([FEED_ASSIGN] IS NULL AND @original_FEED_ASSIGN IS NULL))" 
            InsertCommand="INSERT INTO [tblTicket] ([LOG_BY], [ID_TYPE], [USERID], [COMPANY_NAME],[TITLE], [FIRSTNAME], [LASTNAME], [EMAIL], [PHONE], [MOBILE], [FAX], [ADDRESS], [SUBURB], [STATE], [POSTCODE], [OMEN_HAS], [OMEN_ID], [FEED_TYPE], [FEED_PRIORITY], [FEED_SOURCE], [FEED_ISSUE], [FEED_SUBJECT], [FEED_DEPART], [FEED_PARTNER], [FEED_SOLVED], [FEED_SOLVED_DATE], [FEED_ESCALATE], [FEED_ESCALATE_DATE], [FEED_ASSIGN]) VALUES (@LOG_BY, @ID_TYPE, @USERID, @COMPANY_NAME,@TITLE, @FIRSTNAME, @LASTNAME, @EMAIL, @PHONE, @MOBILE, @FAX, @ADDRESS, @SUBURB, @STATE, @POSTCODE, @OMEN_HAS, @OMEN_ID, @FEED_TYPE, @FEED_PRIORITY, @FEED_SOURCE, @FEED_ISSUE, @FEED_SUBJECT, @FEED_DEPART, @FEED_PARTNER, @FEED_SOLVED, @FEED_SOLVED_DATE, @FEED_ESCALATE, @FEED_ESCALATE_DATE, @FEED_ASSIGN)" 
            OldValuesParameterFormatString="original_{0}" 
            SelectCommand="SELECT * FROM [tblTicket] WHERE ([CFID] = @CFID)" 
            UpdateCommand="UPDATE [tblTicket] SET  [LOG_BY] = @LOG_BY, [ID_TYPE] = @ID_TYPE, [USERID] = @USERID, [COMPANY_NAME] = @COMPANY_NAME,[TITLE] = @TITLE, [FIRSTNAME] = @FIRSTNAME, [LASTNAME] = @LASTNAME, [EMAIL] = @EMAIL, [PHONE] = @PHONE, [MOBILE] = @MOBILE, [FAX] = @FAX, [ADDRESS] = @ADDRESS, [SUBURB] = @SUBURB, [STATE] = @STATE, [POSTCODE] = @POSTCODE, [OMEN_HAS] = @OMEN_HAS, [OMEN_ID] = @OMEN_ID, [FEED_TYPE] = @FEED_TYPE, [FEED_PRIORITY] = @FEED_PRIORITY, [FEED_SOURCE] = @FEED_SOURCE, [FEED_ISSUE] = @FEED_ISSUE, [FEED_SUBJECT] = @FEED_SUBJECT, [FEED_DEPART] = @FEED_DEPART, [FEED_PARTNER] = @FEED_PARTNER, [FEED_SOLVED] = @FEED_SOLVED, [FEED_SOLVED_DATE] = @FEED_SOLVED_DATE, [FEED_ESCALATE] = @FEED_ESCALATE, [FEED_ESCALATE_DATE] = @FEED_ESCALATE_DATE, [FEED_ASSIGN] = @FEED_ASSIGN WHERE [CFID] = @original_CFID AND (([LOG_BY] = @original_LOG_BY) OR ([LOG_BY] IS NULL AND @original_LOG_BY IS NULL)) AND (([ID_TYPE] = @original_ID_TYPE) OR ([ID_TYPE] IS NULL AND @original_ID_TYPE IS NULL)) AND (([USERID] = @original_USERID) OR ([USERID] IS NULL AND @original_USERID IS NULL)) AND (([COMPANY_NAME] = @original_COMPANY_NAME) OR ([COMPANY_NAME] IS NULL AND @original_COMPANY_NAME IS NULL)) AND (([FIRSTNAME] = @original_FIRSTNAME) OR ([FIRSTNAME] IS NULL AND @original_FIRSTNAME IS NULL))AND (([TITLE] = @original_TITLE) OR ([TITLE] IS NULL AND @original_TITLE IS NULL)) AND (([LASTNAME] = @original_LASTNAME) OR ([LASTNAME] IS NULL AND @original_LASTNAME IS NULL)) AND (([EMAIL] = @original_EMAIL) OR ([EMAIL] IS NULL AND @original_EMAIL IS NULL)) AND (([PHONE] = @original_PHONE) OR ([PHONE] IS NULL AND @original_PHONE IS NULL)) AND (([MOBILE] = @original_MOBILE) OR ([MOBILE] IS NULL AND @original_MOBILE IS NULL)) AND (([FAX] = @original_FAX) OR ([FAX] IS NULL AND @original_FAX IS NULL)) AND (([ADDRESS] = @original_ADDRESS) OR ([ADDRESS] IS NULL AND @original_ADDRESS IS NULL)) AND (([SUBURB] = @original_SUBURB) OR ([SUBURB] IS NULL AND @original_SUBURB IS NULL)) AND (([STATE] = @original_STATE) OR ([STATE] IS NULL AND @original_STATE IS NULL)) AND (([POSTCODE] = @original_POSTCODE) OR ([POSTCODE] IS NULL AND @original_POSTCODE IS NULL)) AND (([OMEN_HAS] = @original_OMEN_HAS) OR ([OMEN_HAS] IS NULL AND @original_OMEN_HAS IS NULL)) AND (([OMEN_ID] = @original_OMEN_ID) OR ([OMEN_ID] IS NULL AND @original_OMEN_ID IS NULL)) AND (([FEED_TYPE] = @original_FEED_TYPE) OR ([FEED_TYPE] IS NULL AND @original_FEED_TYPE IS NULL)) AND (([FEED_PRIORITY] = @original_FEED_PRIORITY) OR ([FEED_PRIORITY] IS NULL AND @original_FEED_PRIORITY IS NULL)) AND (([FEED_SOURCE] = @original_FEED_SOURCE) OR ([FEED_SOURCE] IS NULL AND @original_FEED_SOURCE IS NULL)) AND (([FEED_ISSUE] = @original_FEED_ISSUE) OR ([FEED_ISSUE] IS NULL AND @original_FEED_ISSUE IS NULL)) AND (([FEED_SUBJECT] = @original_FEED_SUBJECT) OR ([FEED_SUBJECT] IS NULL AND @original_FEED_SUBJECT IS NULL)) AND (([FEED_DEPART] = @original_FEED_DEPART) OR ([FEED_DEPART] IS NULL AND @original_FEED_DEPART IS NULL)) AND (([FEED_PARTNER] = @original_FEED_PARTNER) OR ([FEED_PARTNER] IS NULL AND @original_FEED_PARTNER IS NULL)) AND (([FEED_SOLVED] = @original_FEED_SOLVED) OR ([FEED_SOLVED] IS NULL AND @original_FEED_SOLVED IS NULL)) AND (([FEED_SOLVED_DATE] = @original_FEED_SOLVED_DATE) OR ([FEED_SOLVED_DATE] IS NULL AND @original_FEED_SOLVED_DATE IS NULL)) AND (([FEED_ESCALATE] = @original_FEED_ESCALATE) OR ([FEED_ESCALATE] IS NULL AND @original_FEED_ESCALATE IS NULL)) AND (([FEED_ESCALATE_DATE] = @original_FEED_ESCALATE_DATE) OR ([FEED_ESCALATE_DATE] IS NULL AND @original_FEED_ESCALATE_DATE IS NULL)) AND (([FEED_ASSIGN] = @original_FEED_ASSIGN) OR ([FEED_ASSIGN] IS NULL AND @original_FEED_ASSIGN IS NULL))">
            <DeleteParameters>
                <asp:Parameter Name="original_CFID" Type="Int32" />
                <asp:Parameter Name="original_REGI_DATE" Type="DateTime" />
                <asp:Parameter Name="original_LOG_BY" Type="String" />
                <asp:Parameter Name="original_ID_TYPE" Type="String" />
                <asp:Parameter Name="original_USERID" Type="String" />
                <asp:Parameter Name="original_COMPANY_NAME" Type="String" />
                <asp:Parameter Name="original_TITLE" Type="String" />
                <asp:Parameter Name="original_FIRSTNAME" Type="String" />
                <asp:Parameter Name="original_LASTNAME" Type="String" />
                <asp:Parameter Name="original_EMAIL" Type="String" />
                <asp:Parameter Name="original_PHONE" Type="String" />
                <asp:Parameter Name="original_MOBILE" Type="String" />
                <asp:Parameter Name="original_FAX" Type="String" />
                <asp:Parameter Name="original_ADDRESS" Type="String" />
                <asp:Parameter Name="original_SUBURB" Type="String" />
                <asp:Parameter Name="original_STATE" Type="String" />
                <asp:Parameter Name="original_POSTCODE" Type="String" />
                <asp:Parameter Name="original_OMEN_HAS" Type="String" />
                <asp:Parameter Name="original_OMEN_ID" Type="String" />
                <asp:Parameter Name="original_FEED_TYPE" Type="String" />
                <asp:Parameter Name="original_FEED_PRIORITY" Type="String" />
                <asp:Parameter Name="original_FEED_SOURCE" Type="String" />
                <asp:Parameter Name="original_FEED_ISSUE" Type="String" />
                <asp:Parameter Name="original_FEED_SUBJECT" Type="String" />
                <asp:Parameter Name="original_FEED_DEPART" Type="String" />
                <asp:Parameter Name="original_FEED_PARTNER" Type="String" />
                <asp:Parameter Name="original_FEED_SOLVED" Type="String" />
                <asp:Parameter Name="original_FEED_SOLVED_DATE" Type="DateTime" />
                <asp:Parameter Name="original_FEED_ESCALATE" Type="String" />
                <asp:Parameter Name="original_FEED_ESCALATE_DATE" Type="DateTime" />
                <asp:Parameter Name="original_FEED_ASSIGN" Type="String" />
            </DeleteParameters>
            <InsertParameters>
                <asp:Parameter Name="LOG_BY" Type="String" />
                <asp:Parameter Name="ID_TYPE" Type="String" />
                <asp:Parameter Name="USERID" Type="String" />
                <asp:Parameter Name="COMPANY_NAME" Type="String" />
                <asp:Parameter Name="TITLE" Type="String" />
                <asp:Parameter Name="FIRSTNAME" Type="String" />
                <asp:Parameter Name="LASTNAME" Type="String" />
                <asp:Parameter Name="EMAIL" Type="String" />
                <asp:Parameter Name="PHONE" Type="String" />
                <asp:Parameter Name="MOBILE" Type="String" />
                <asp:Parameter Name="FAX" Type="String" />
                <asp:Parameter Name="ADDRESS" Type="String" />
                <asp:Parameter Name="SUBURB" Type="String" />
                <asp:Parameter Name="STATE" Type="String" />
                <asp:Parameter Name="POSTCODE" Type="String" />
                <asp:Parameter Name="OMEN_HAS" Type="String" />
                <asp:Parameter Name="OMEN_ID" Type="String" />
                <asp:Parameter Name="FEED_TYPE" Type="String" />
                <asp:Parameter Name="FEED_PRIORITY" Type="String" />
                <asp:Parameter Name="FEED_SOURCE" Type="String" />
                <asp:Parameter Name="FEED_ISSUE" Type="String" />
                <asp:Parameter Name="FEED_SUBJECT" Type="String" />
                <asp:Parameter Name="FEED_DEPART" Type="String" />
                <asp:Parameter Name="FEED_PARTNER" Type="String" />
                <asp:Parameter Name="FEED_SOLVED" Type="String" />
                <asp:Parameter Name="FEED_SOLVED_DATE" Type="DateTime" />
                <asp:Parameter Name="FEED_ESCALATE" Type="String" />
                <asp:Parameter Name="FEED_ESCALATE_DATE" Type="DateTime" />
                <asp:Parameter Name="FEED_ASSIGN" Type="String" />
            </InsertParameters>
            <SelectParameters>
                <asp:ControlParameter ControlID="GridView1" Name="CFID" 
                    PropertyName="SelectedValue" Type="Int32" />
            </SelectParameters>
            <UpdateParameters>
                <asp:Parameter Name="LOG_BY" Type="String" />
                <asp:Parameter Name="ID_TYPE" Type="String" />
                <asp:Parameter Name="USERID" Type="String" />
                <asp:Parameter Name="COMPANY_NAME" Type="String" />
                <asp:Parameter Name="TITLE" Type="String" />
                <asp:Parameter Name="FIRSTNAME" Type="String" />
                <asp:Parameter Name="LASTNAME" Type="String" />
                <asp:Parameter Name="EMAIL" Type="String" />
                <asp:Parameter Name="PHONE" Type="String" />
                <asp:Parameter Name="MOBILE" Type="String" />
                <asp:Parameter Name="FAX" Type="String" />
                <asp:Parameter Name="ADDRESS" Type="String" />
                <asp:Parameter Name="SUBURB" Type="String" />
                <asp:Parameter Name="STATE" Type="String" />
                <asp:Parameter Name="POSTCODE" Type="String" />
                <asp:Parameter Name="OMEN_HAS" Type="String" />
                <asp:Parameter Name="OMEN_ID" Type="String" />
                <asp:Parameter Name="FEED_TYPE" Type="String" />
                <asp:Parameter Name="FEED_PRIORITY" Type="String" />
                <asp:Parameter Name="FEED_SOURCE" Type="String" />
                <asp:Parameter Name="FEED_ISSUE" Type="String" />
                <asp:Parameter Name="FEED_SUBJECT" Type="String" />
                <asp:Parameter Name="FEED_DEPART" Type="String" />
                <asp:Parameter Name="FEED_PARTNER" Type="String" />
                <asp:Parameter Name="FEED_SOLVED" Type="String" />
                <asp:Parameter Name="FEED_SOLVED_DATE" Type="DateTime" />
                <asp:Parameter Name="FEED_ESCALATE" Type="String" />
                <asp:Parameter Name="FEED_ESCALATE_DATE" Type="DateTime" />
                <asp:Parameter Name="FEED_ASSIGN" Type="String" />
                <asp:Parameter Name="original_CFID" Type="Int32" />

                <asp:Parameter Name="original_LOG_BY" Type="String" />
                <asp:Parameter Name="original_ID_TYPE" Type="String" />
                <asp:Parameter Name="original_USERID" Type="String" />
                <asp:Parameter Name="original_COMPANY_NAME" Type="String" />
                <asp:Parameter Name="original_TITLE" Type="String" />
                <asp:Parameter Name="original_FIRSTNAME" Type="String" />
                <asp:Parameter Name="original_LASTNAME" Type="String" />
                <asp:Parameter Name="original_EMAIL" Type="String" />
                <asp:Parameter Name="original_PHONE" Type="String" />
                <asp:Parameter Name="original_MOBILE" Type="String" />
                <asp:Parameter Name="original_FAX" Type="String" />
                <asp:Parameter Name="original_ADDRESS" Type="String" />
                <asp:Parameter Name="original_SUBURB" Type="String" />
                <asp:Parameter Name="original_STATE" Type="String" />
                <asp:Parameter Name="original_POSTCODE" Type="String" />
                <asp:Parameter Name="original_OMEN_HAS" Type="String" />
                <asp:Parameter Name="original_OMEN_ID" Type="String" />
                <asp:Parameter Name="original_FEED_TYPE" Type="String" />
                <asp:Parameter Name="original_FEED_PRIORITY" Type="String" />
                <asp:Parameter Name="original_FEED_SOURCE" Type="String" />
                <asp:Parameter Name="original_FEED_ISSUE" Type="String" />
                <asp:Parameter Name="original_FEED_SUBJECT" Type="String" />
                <asp:Parameter Name="original_FEED_DEPART" Type="String" />
                <asp:Parameter Name="original_FEED_PARTNER" Type="String" />
                <asp:Parameter Name="original_FEED_SOLVED" Type="String" />
                <asp:Parameter Name="original_FEED_SOLVED_DATE" Type="DateTime" />
                <asp:Parameter Name="original_FEED_ESCALATE" Type="String" />
                <asp:Parameter Name="original_FEED_ESCALATE_DATE" Type="DateTime" />
                <asp:Parameter Name="original_FEED_ASSIGN" Type="String" />
            </UpdateParameters>
        </asp:SqlDataSource>
    


        <asp:DetailsView ID="DetailsView1" runat="Server" DataSourceID="SqlDataSource2" 
            AllowPaging="True" AutoGenerateRows="False"  
        DataKeyNames="CFID" CssClass="mGrid" DefaultMode="Edit"
        PagerStyle-CssClass="pgr" AlternatingRowStyle-CssClass="alt"  FieldHeaderStyle-Font-Bold="true" 
        Font-Names="Times New Roman" CommandRowStyle-Font-Size="13"   CommandRowStyle-ForeColor="red" 
            EnableModelValidation="True"
            OnItemCommand="DetailsView1_ItemCommand"
            OnItemInserted="DetailsView1_ItemInserted"
            OnItemUpdated="DetailsView1_ItemUpdated">  


            <AlternatingRowStyle CssClass="alt"></AlternatingRowStyle>

            <CommandRowStyle Font-Size="13pt" ForeColor="Red"></CommandRowStyle>

            <FieldHeaderStyle Font-Bold="True"></FieldHeaderStyle>



            <Fields>



                <asp:TemplateField HeaderText="CFID" SortExpression="CFID" InsertVisible="False">
                    <EditItemTemplate>
                        <asp:Label ID="CFID" runat="server" Text='<%# Bind("CFID") %>'></asp:Label>
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:Label ID="CFID" runat="server" Text='<%# Bind("CFID") %>'></asp:Label>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="CFID" runat="server" Text='<%# Bind("CFID") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>

                <asp:TemplateField HeaderText="Registration Date" SortExpression="REGI_DATE">
                    <EditItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# Bind("REGI_DATE") %>'></asp:Label>
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# Bind("REGI_DATE") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Log By" SortExpression="LOG_BY">
                    <EditItemTemplate>
                        <asp:Label ID="LOG_BY" runat="server" Text='<%# Bind("LOG_BY") %>'></asp:Label>
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:TextBox ID="LOG_BY" runat="server" Text='<%# Bind("LOG_BY") %>' Visible="false"></asp:TextBox>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="LOG_BY" runat="server" Text='<%# Bind("LOG_BY") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Customer Type" SortExpression="ID_TYPE">
                    <EditItemTemplate>


                        <asp:DropDownList ID="SelID_TYPE" runat="server" OnSelectedIndexChanged="SelID_TYPEChanged" AutoPostBack="true" SelectedValue='<%# Bind("ID_TYPE") %>' >
                                        <asp:ListItem Value="">-Select One-</asp:ListItem>
                                        <asp:ListItem Value="NEW">New Client</asp:ListItem>
                                        <asp:ListItem Value="RESI">Exist RESI&SME</asp:ListItem>
                                        <asp:ListItem Value="CI">Exist CI</asp:ListItem>                                          
                                    </asp:DropDownList>


                        <asp:MultiView ID="MultiView1" runat="server" ActiveViewIndex="0">
                            <asp:View ID="View0" runat="server">
                                


                            </asp:View>
                            <asp:View ID="View1" runat="server">

                                <asp:Panel ID="panSearch" runat="server" DefaultButton="btnsearch_ci" Width="100%" >
                
                                        <ASP:TextBox runat="server" type="text" id="searchBox_ci" Width="250px"/>
                                        <asp:Button ID="btnsearch_ci" runat="server" Text="Search by FirstName/LastName/Email/CompanyName" />

                                </asp:Panel>  

                                <asp:SqlDataSource ID="SqlDataSource3" runat="server" 
                                    ConnectionString="<%$ ConnectionStrings:SQLServer2005DBConnectionString %>" 
                                    
                                    SelectCommand="SELECT [USERID], [REGI_DATE], [COMPANY_NAME], [TITLE], [FIRST_NAME], [LAST_NAME], [EMAIL], [BPHONE], [MOBILE], [FAX], [NOTICE_ADDRESS], [NOTICE_SUBURB], [NOTICE_STATE], [NOTICE_POSTCODE] FROM [tblCI]  ORDER BY [USERID] DESC"
                                
                                    filterexpression="COMPANY_NAME LIKE '%{0}%' or FIRST_NAME  LIKE '%{0}%' or LAST_NAME LIKE '%{0}%'  or EMAIL  LIKE '%{0}%'">
                                    <filterparameters>
                                        <asp:controlparameter controlid="searchBox_ci" propertyname="Text" />
                                    </filterparameters>
                                </asp:SqlDataSource>
                                
                                <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" 
                                    DataKeyNames="USERID" DataSourceID="SqlDataSource3" 
                                    EnableModelValidation="True" AllowPaging="True" AllowSorting="True">
                                    <Columns>
                                        <asp:CommandField ShowSelectButton="True" />
                                        <asp:BoundField DataField="USERID" HeaderText="USERID" InsertVisible="False" 
                                            ReadOnly="True" SortExpression="USERID" />
                                        <asp:BoundField DataField="REGI_DATE" HeaderText="REGI_DATE" 
                                            SortExpression="REGI_DATE" />
                                        <asp:BoundField DataField="COMPANY_NAME" HeaderText="COMPANY_NAME" 
                                            SortExpression="COMPANY_NAME" />
                                        <asp:BoundField DataField="TITLE" HeaderText="TITLE" 
                                            SortExpression="TITLE" />
                                        <asp:BoundField DataField="FIRST_NAME" HeaderText="FIRST_NAME" 
                                            SortExpression="FIRST_NAME" />
                                        <asp:BoundField DataField="LAST_NAME" HeaderText="LAST_NAME" 
                                            SortExpression="LAST_NAME" />
                                        <asp:BoundField DataField="EMAIL" HeaderText="EMAIL" SortExpression="EMAIL" />
                                        <asp:BoundField DataField="BPHONE" HeaderText="BPHONE" 
                                            SortExpression="BPHONE" />
                                        <asp:BoundField DataField="MOBILE" HeaderText="MOBILE" 
                                            SortExpression="MOBILE" />
                                        <asp:BoundField DataField="FAX" HeaderText="FAX" SortExpression="FAX" />
                                        <asp:BoundField DataField="NOTICE_ADDRESS" HeaderText="NOTICE_ADDRESS" 
                                            SortExpression="NOTICE_ADDRESS" />
                                        <asp:BoundField DataField="NOTICE_SUBURB" HeaderText="NOTICE_SUBURB" 
                                            SortExpression="NOTICE_SUBURB" />
                                        <asp:BoundField DataField="NOTICE_STATE" HeaderText="NOTICE_STATE" 
                                            SortExpression="NOTICE_STATE" />
                                        <asp:BoundField DataField="NOTICE_POSTCODE" HeaderText="NOTICE_POSTCODE" 
                                            SortExpression="NOTICE_POSTCODE" />
                                    </Columns>
                                </asp:GridView>
                                <asp:SqlDataSource ID="SqlDataSource5" runat="server" 
                                    ConnectionString="<%$ ConnectionStrings:SQLServer2005DBConnectionString %>" 
                                    SelectCommand="SELECT [USERID], [REGI_DATE], [COMPANY_NAME], [TITLE], [FIRST_NAME], [LAST_NAME], [EMAIL], [BPHONE], [MOBILE], [FAX], [NOTICE_ADDRESS], [NOTICE_SUBURB], [NOTICE_STATE], [NOTICE_POSTCODE] FROM [tblCI] WHERE ([USERID] = @USERID)">
                                    <SelectParameters>
                                        <asp:ControlParameter ControlID="GridView2" Name="USERID" 
                                            PropertyName="SelectedValue" Type="Int32" />
                                    </SelectParameters>
                                </asp:SqlDataSource>
                                <asp:FormView ID="FormView1" runat="server" DataKeyNames="USERID" 
                                    DataSourceID="SqlDataSource5" EnableModelValidation="True">
                                    <EditItemTemplate>
                                        USERID:
                                        <asp:Label ID="USERIDLabel1" runat="server" Text='<%# Eval("USERID") %>' />
                                        <br />
                                        REGI_DATE:
                                        <asp:TextBox ID="REGI_DATETextBox" runat="server" 
                                            Text='<%# Bind("REGI_DATE") %>' />
                                        <br />
                                        COMPANY_NAME:
                                        <asp:TextBox ID="COMPANY_NAMETextBox" runat="server" 
                                            Text='<%# Bind("COMPANY_NAME") %>' />
                                        <br />
                                        TITLE:
                                        <asp:TextBox ID="TITLETextBox" runat="server" Text='<%# Bind("TITLE") %>' />
                                        <br />
                                        FIRST_NAME:
                                        <asp:TextBox ID="FIRST_NAMETextBox" runat="server" 
                                            Text='<%# Bind("FIRST_NAME") %>' />
                                        <br />
                                        LAST_NAME:
                                        <asp:TextBox ID="LAST_NAMETextBox" runat="server" 
                                            Text='<%# Bind("LAST_NAME") %>' />
                                        <br />
                                        EMAIL:
                                        <asp:TextBox ID="EMAILTextBox" runat="server" Text='<%# Bind("EMAIL") %>' />
                                        <br />
                                        BPHONE:
                                        <asp:TextBox ID="BPHONETextBox" runat="server" Text='<%# Bind("BPHONE") %>' />
                                        <br />
                                        MOBILE:
                                        <asp:TextBox ID="MOBILETextBox" runat="server" Text='<%# Bind("MOBILE") %>' />
                                        <br />
                                        FAX:
                                        <asp:TextBox ID="FAXTextBox" runat="server" Text='<%# Bind("FAX") %>' />
                                        <br />
                                        NOTICE_ADDRESS:
                                        <asp:TextBox ID="NOTICE_ADDRESSTextBox" runat="server" 
                                            Text='<%# Bind("NOTICE_ADDRESS") %>' />
                                        <br />
                                        NOTICE_SUBURB:
                                        <asp:TextBox ID="NOTICE_SUBURBTextBox" runat="server" 
                                            Text='<%# Bind("NOTICE_SUBURB") %>' />
                                        <br />
                                        NOTICE_STATE:
                                        <asp:TextBox ID="NOTICE_STATETextBox" runat="server" 
                                            Text='<%# Bind("NOTICE_STATE") %>' />
                                        <br />
                                        NOTICE_POSTCODE:
                                        <asp:TextBox ID="NOTICE_POSTCODETextBox" runat="server" 
                                            Text='<%# Bind("NOTICE_POSTCODE") %>' />
                                        <br />
                                        <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" 
                                            CommandName="Update" Text="Update" />
                                        &nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server" 
                                            CausesValidation="False" CommandName="Cancel" Text="Cancel" />
                                    </EditItemTemplate>
                                    <InsertItemTemplate>
                                        REGI_DATE:
                                        <asp:TextBox ID="REGI_DATETextBox" runat="server" 
                                            Text='<%# Bind("REGI_DATE") %>' />
                                        <br />
                                        COMPANY_NAME:
                                        <asp:TextBox ID="COMPANY_NAMETextBox" runat="server" 
                                            Text='<%# Bind("COMPANY_NAME") %>' />
                                        <br />
                                        TITLE:
                                        <asp:TextBox ID="TITLETextBox" runat="server" Text='<%# Bind("TITLE") %>' />
                                        <br />
                                        FIRST_NAME:
                                        <asp:TextBox ID="FIRST_NAMETextBox" runat="server" 
                                            Text='<%# Bind("FIRST_NAME") %>' />
                                        <br />
                                        LAST_NAME:
                                        <asp:TextBox ID="LAST_NAMETextBox" runat="server" 
                                            Text='<%# Bind("LAST_NAME") %>' />
                                        <br />
                                        EMAIL:
                                        <asp:TextBox ID="EMAILTextBox" runat="server" Text='<%# Bind("EMAIL") %>' />
                                        <br />
                                        BPHONE:
                                        <asp:TextBox ID="BPHONETextBox" runat="server" Text='<%# Bind("BPHONE") %>' />
                                        <br />
                                        MOBILE:
                                        <asp:TextBox ID="MOBILETextBox" runat="server" Text='<%# Bind("MOBILE") %>' />
                                        <br />
                                        FAX:
                                        <asp:TextBox ID="FAXTextBox" runat="server" Text='<%# Bind("FAX") %>' />
                                        <br />
                                        NOTICE_ADDRESS:
                                        <asp:TextBox ID="NOTICE_ADDRESSTextBox" runat="server" 
                                            Text='<%# Bind("NOTICE_ADDRESS") %>' />
                                        <br />
                                        NOTICE_SUBURB:
                                        <asp:TextBox ID="NOTICE_SUBURBTextBox" runat="server" 
                                            Text='<%# Bind("NOTICE_SUBURB") %>' />
                                        <br />
                                        NOTICE_STATE:
                                        <asp:TextBox ID="NOTICE_STATETextBox" runat="server" 
                                            Text='<%# Bind("NOTICE_STATE") %>' />
                                        <br />
                                        NOTICE_POSTCODE:
                                        <asp:TextBox ID="NOTICE_POSTCODETextBox" runat="server" 
                                            Text='<%# Bind("NOTICE_POSTCODE") %>' />
                                        <br />
                                        <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" 
                                            CommandName="Insert" Text="Insert" />
                                        &nbsp;<asp:LinkButton ID="InsertCancelButton" runat="server" 
                                            CausesValidation="False" CommandName="Cancel" Text="Cancel" />
                                    </InsertItemTemplate>
                                    <ItemTemplate>
                                        USERID:
                                        <asp:Label ID="USERIDLabel" runat="server" Text='<%# Eval("USERID") %>' />
                                        <br />
                                        REGI_DATE:
                                        <asp:Label ID="REGI_DATELabel" runat="server" Text='<%# Bind("REGI_DATE") %>' />
                                        <br />
                                        COMPANY_NAME:
                                        <asp:Label ID="COMPANY_NAMELabel" runat="server" 
                                            Text='<%# Bind("COMPANY_NAME") %>' />
                                        <br />
                                        TITLE:
                                        <asp:Label ID="TITLELabel" runat="server" Text='<%# Bind("TITLE") %>' />
                                        <br />
                                        FIRST_NAME:
                                        <asp:Label ID="FIRST_NAMELabel" runat="server" 
                                            Text='<%# Bind("FIRST_NAME") %>' />
                                        <br />
                                        LAST_NAME:
                                        <asp:Label ID="LAST_NAMELabel" runat="server" Text='<%# Bind("LAST_NAME") %>' />
                                        <br />
                                        EMAIL:
                                        <asp:Label ID="EMAILLabel" runat="server" Text='<%# Bind("EMAIL") %>' />
                                        <br />
                                        BPHONE:
                                        <asp:Label ID="BPHONELabel" runat="server" Text='<%# Bind("BPHONE") %>' />
                                        <br />
                                        MOBILE:
                                        <asp:Label ID="MOBILELabel" runat="server" Text='<%# Bind("MOBILE") %>' />
                                        <br />
                                        FAX:
                                        <asp:Label ID="FAXLabel" runat="server" Text='<%# Bind("FAX") %>' />
                                        <br />
                                        NOTICE_ADDRESS:
                                        <asp:Label ID="NOTICE_ADDRESSLabel" runat="server" 
                                            Text='<%# Bind("NOTICE_ADDRESS") %>' />
                                        <br />
                                        NOTICE_SUBURB:
                                        <asp:Label ID="NOTICE_SUBURBLabel" runat="server" 
                                            Text='<%# Bind("NOTICE_SUBURB") %>' />
                                        <br />
                                        NOTICE_STATE:
                                        <asp:Label ID="NOTICE_STATELabel" runat="server" 
                                            Text='<%# Bind("NOTICE_STATE") %>' />
                                        <br />
                                        NOTICE_POSTCODE:
                                        <asp:Label ID="NOTICE_POSTCODELabel" runat="server" 
                                            Text='<%# Bind("NOTICE_POSTCODE") %>' />
                                        <br />
                                        <input type="button" ID="CopyCI" runat="server" value="Copy Customer Details" onclick="CopyCIChanged()"/>
                                    </ItemTemplate>
                                </asp:FormView>

                            </asp:View>
                            <asp:View ID="View2" runat="server">

                                <asp:Panel ID="panSearch2" runat="server" DefaultButton="btnsearch2" Width="100%" >
                
                                        <ASP:TextBox runat="server" type="text" id="searchBox2" Width="250px"/>
                                        <asp:Button ID="btnsearch2" runat="server" Text="Search by FirstName/LastName/Email/CompanyName" />

                                </asp:Panel>  

                                <asp:SqlDataSource ID="SqlDataSource4" runat="server" 
                                    ConnectionString="<%$ ConnectionStrings:SQLServer2005DBConnectionString %>" 
                                    SelectCommand="SELECT [UserID], [CompanyName], [FirstAccountHolderTitle], [FirstName], [LastName], [Email], [Phone], [Mobile], [Fax], [Street], [Suburb], [StateName], [Postcode] FROM [tblUser] ORDER BY [UserID] DESC"

                                    filterexpression="CompanyName LIKE '%{0}%' or FirstName  LIKE '%{0}%' or LastName LIKE '%{0}%'  or Email  LIKE '%{0}%'">
                                    <filterparameters>
                                        <asp:controlparameter controlid="searchBox2" propertyname="Text" />
                                    </filterparameters>
                                </asp:SqlDataSource>


                                <asp:GridView ID="GridView3" runat="server" AutoGenerateColumns="False" 
                                    DataSourceID="SqlDataSource4" EnableModelValidation="True" DataKeyNames="UserID"
                                    AllowPaging="True" AllowSorting="True">
                                    <Columns>
                                        <asp:CommandField ShowSelectButton="True" />
                                        <asp:BoundField DataField="UserID" HeaderText="UserID" 
                                            SortExpression="UserID" />
                                        <asp:BoundField DataField="CompanyName" HeaderText="CompanyName" 
                                            SortExpression="CompanyName" />
                                        <asp:BoundField DataField="FirstAccountHolderTitle" HeaderText="FirstAccountHolderTitle" 
                                            SortExpression="FirstAccountHolderTitle" />
                                        <asp:BoundField DataField="FirstName" HeaderText="FirstName" 
                                            SortExpression="FirstName" />
                                        <asp:BoundField DataField="LastName" HeaderText="LastName" 
                                            SortExpression="LastName" />
                                        <asp:BoundField DataField="Email" HeaderText="Email" SortExpression="Email" />
                                        <asp:BoundField DataField="Phone" HeaderText="Phone" SortExpression="Phone" />
                                        <asp:BoundField DataField="Mobile" HeaderText="Mobile" 
                                            SortExpression="Mobile" />
                                        <asp:BoundField DataField="Fax" HeaderText="Fax" SortExpression="Fax" />
                                        <asp:BoundField DataField="Street" HeaderText="Street" 
                                            SortExpression="Street" />
                                        <asp:BoundField DataField="Suburb" HeaderText="Suburb" 
                                            SortExpression="Suburb" />
                                        <asp:BoundField DataField="StateName" HeaderText="StateName" 
                                            SortExpression="StateName" />
                                        <asp:BoundField DataField="Postcode" HeaderText="Postcode" 
                                            SortExpression="Postcode" />
                                    </Columns>
                                </asp:GridView>

                                <asp:SqlDataSource ID="SqlDataSource6" runat="server" 
                                    ConnectionString="<%$ ConnectionStrings:SQLServer2005DBConnectionString %>" 
                                    SelectCommand="SELECT [UserID], [CompanyName], [FirstAccountHolderTitle], [FirstName], [LastName], [Email], [Phone], [Mobile], [Fax], [Street], [Suburb], [StateName], [Postcode] FROM [tblUser] WHERE ([UserID] = @UserID)">
                                    <SelectParameters>
                                        <asp:ControlParameter ControlID="GridView3" Name="UserID" 
                                            PropertyName="SelectedValue" Type="Int32" />
                                    </SelectParameters>
                                </asp:SqlDataSource>
                                <asp:FormView ID="FormView2" runat="server" DataSourceID="SqlDataSource6" 
                                    EnableModelValidation="True">
                                    <EditItemTemplate>
                                        UserID:
                                        <asp:TextBox ID="UserIDTextBox" runat="server" Text='<%# Bind("UserID") %>' />
                                        <br />
                                        CompanyName:
                                        <asp:TextBox ID="CompanyNameTextBox" runat="server" 
                                            Text='<%# Bind("CompanyName") %>' />
                                        <br />
                                        FirstAccountHolderTitle:
                                        <asp:TextBox ID="FirstAccountHolderTitleTextBox" runat="server" 
                                            Text='<%# Bind("FirstAccountHolderTitle") %>' />
                                        <br />
                                        FirstName:
                                        <asp:TextBox ID="FirstNameTextBox" runat="server" 
                                            Text='<%# Bind("FirstName") %>' />
                                        <br />
                                        LastName:
                                        <asp:TextBox ID="LastNameTextBox" runat="server" 
                                            Text='<%# Bind("LastName") %>' />
                                        <br />
                                        Email:
                                        <asp:TextBox ID="EmailTextBox" runat="server" Text='<%# Bind("Email") %>' />
                                        <br />
                                        Phone:
                                        <asp:TextBox ID="PhoneTextBox" runat="server" Text='<%# Bind("Phone") %>' />
                                        <br />
                                        Mobile:
                                        <asp:TextBox ID="MobileTextBox" runat="server" Text='<%# Bind("Mobile") %>' />
                                        <br />
                                        Fax:
                                        <asp:TextBox ID="FaxTextBox" runat="server" Text='<%# Bind("Fax") %>' />
                                        <br />
                                        Street:
                                        <asp:TextBox ID="StreetTextBox" runat="server" Text='<%# Bind("Street") %>' />
                                        <br />
                                        Suburb:
                                        <asp:TextBox ID="SuburbTextBox" runat="server" Text='<%# Bind("Suburb") %>' />
                                        <br />
                                        StateName:
                                        <asp:TextBox ID="StateNameTextBox" runat="server" 
                                            Text='<%# Bind("StateName") %>' />
                                        <br />
                                        Postcode:
                                        <asp:TextBox ID="PostcodeTextBox" runat="server" 
                                            Text='<%# Bind("Postcode") %>' />
                                        <br />
                                        <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" 
                                            CommandName="Update" Text="Update" />
                                        &nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server" 
                                            CausesValidation="False" CommandName="Cancel" Text="Cancel" />
                                    </EditItemTemplate>
                                    <InsertItemTemplate>
                                        UserID:
                                        <asp:TextBox ID="UserIDTextBox" runat="server" Text='<%# Bind("UserID") %>' />
                                        <br />
                                        CompanyName:
                                        <asp:TextBox ID="CompanyNameTextBox" runat="server" 
                                            Text='<%# Bind("CompanyName") %>' />
                                        <br />
                                        FirstAccountHolderTitle:
                                        <asp:TextBox ID="FirstAccountHolderTitleTextBox" runat="server" 
                                            Text='<%# Bind("FirstAccountHolderTitle") %>' />
                                        <br />
                                        FirstName:
                                        <asp:TextBox ID="FirstNameTextBox" runat="server" 
                                            Text='<%# Bind("FirstName") %>' />
                                        <br />
                                        LastName:
                                        <asp:TextBox ID="LastNameTextBox" runat="server" 
                                            Text='<%# Bind("LastName") %>' />
                                        <br />
                                        Email:
                                        <asp:TextBox ID="EmailTextBox" runat="server" Text='<%# Bind("Email") %>' />
                                        <br />
                                        Phone:
                                        <asp:TextBox ID="PhoneTextBox" runat="server" Text='<%# Bind("Phone") %>' />
                                        <br />
                                        Mobile:
                                        <asp:TextBox ID="MobileTextBox" runat="server" Text='<%# Bind("Mobile") %>' />
                                        <br />
                                        Fax:
                                        <asp:TextBox ID="FaxTextBox" runat="server" Text='<%# Bind("Fax") %>' />
                                        <br />
                                        Street:
                                        <asp:TextBox ID="StreetTextBox" runat="server" Text='<%# Bind("Street") %>' />
                                        <br />
                                        Suburb:
                                        <asp:TextBox ID="SuburbTextBox" runat="server" Text='<%# Bind("Suburb") %>' />
                                        <br />
                                        StateName:
                                        <asp:TextBox ID="StateNameTextBox" runat="server" 
                                            Text='<%# Bind("StateName") %>' />
                                        <br />
                                        Postcode:
                                        <asp:TextBox ID="PostcodeTextBox" runat="server" 
                                            Text='<%# Bind("Postcode") %>' />
                                        <br />
                                        <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" 
                                            CommandName="Insert" Text="Insert" />
                                        &nbsp;<asp:LinkButton ID="InsertCancelButton" runat="server" 
                                            CausesValidation="False" CommandName="Cancel" Text="Cancel" />
                                    </InsertItemTemplate>
                                    <ItemTemplate>
                                        UserID:
                                        <asp:Label ID="UserIDLabel" runat="server" Text='<%# Bind("UserID") %>' />
                                        <br />
                                        CompanyName:
                                        <asp:Label ID="CompanyNameLabel" runat="server" 
                                            Text='<%# Bind("CompanyName") %>' />
                                        <br />
                                        FirstAccountHolderTitle:
                                        <asp:Label ID="FirstAccountHolderTitleLabel" runat="server" 
                                            Text='<%# Bind("FirstAccountHolderTitle") %>' />
                                        <br />
                                        FirstName:
                                        <asp:Label ID="FirstNameLabel" runat="server" Text='<%# Bind("FirstName") %>' />
                                        <br />
                                        LastName:
                                        <asp:Label ID="LastNameLabel" runat="server" Text='<%# Bind("LastName") %>' />
                                        <br />
                                        Email:
                                        <asp:Label ID="EmailLabel" runat="server" Text='<%# Bind("Email") %>' />
                                        <br />
                                        Phone:
                                        <asp:Label ID="PhoneLabel" runat="server" Text='<%# Bind("Phone") %>' />
                                        <br />
                                        Mobile:
                                        <asp:Label ID="MobileLabel" runat="server" Text='<%# Bind("Mobile") %>' />
                                        <br />
                                        Fax:
                                        <asp:Label ID="FaxLabel" runat="server" Text='<%# Bind("Fax") %>' />
                                        <br />
                                        Street:
                                        <asp:Label ID="StreetLabel" runat="server" Text='<%# Bind("Street") %>' />
                                        <br />
                                        Suburb:
                                        <asp:Label ID="SuburbLabel" runat="server" Text='<%# Bind("Suburb") %>' />
                                        <br />
                                        StateName:
                                        <asp:Label ID="StateNameLabel" runat="server" Text='<%# Bind("StateName") %>' />
                                        <br />
                                        Postcode:
                                        <asp:Label ID="PostcodeLabel" runat="server" Text='<%# Bind("Postcode") %>' />
                                        <br />
                                        <input type="button" ID="ButtonCopyRS" runat="server" value="Copy Customer Details" onclick="CopyRSChanged()"/>
                                    </ItemTemplate>
                                </asp:FormView>
                            </asp:View>
                        </asp:MultiView>


                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:DropDownList ID="SelID_TYPE" runat="server" OnSelectedIndexChanged="SelID_TYPEChanged" AutoPostBack="true" SelectedValue='<%# Bind("ID_TYPE") %>' >
                                        <asp:ListItem Value="">-Select One-</asp:ListItem>
                                        <asp:ListItem Value="NEW">New Client</asp:ListItem>
                                        <asp:ListItem Value="RESI">Exist RESI&SME</asp:ListItem>
                                        <asp:ListItem Value="CI">Exist CI</asp:ListItem>                                          
                                    </asp:DropDownList>


                        <asp:MultiView ID="MultiView1" runat="server" ActiveViewIndex="0">
                            <asp:View ID="View0" runat="server">
                                


                            </asp:View>
                            <asp:View ID="View1" runat="server">

                                <asp:Panel ID="panSearch" runat="server" DefaultButton="btnsearch" Width="100%" >
                
                                        <ASP:TextBox runat="server" type="text" id="searchBox" Width="250px"/>
                                        <asp:Button ID="btnsearch" runat="server" Text="Search by FirstName/LastName/Email/CompanyName" />

                                </asp:Panel>  

                                <asp:SqlDataSource ID="SqlDataSource3" runat="server" 
                                    ConnectionString="<%$ ConnectionStrings:SQLServer2005DBConnectionString %>" 
                                    
                                    SelectCommand="SELECT [USERID], [REGI_DATE], [COMPANY_NAME], [TITLE], [FIRST_NAME], [LAST_NAME], [EMAIL], [BPHONE], [MOBILE], [FAX], [NOTICE_ADDRESS], [NOTICE_SUBURB], [NOTICE_STATE], [NOTICE_POSTCODE] FROM [tblCI]  ORDER BY [USERID] DESC"
                                
                                    filterexpression="COMPANY_NAME LIKE '%{0}%' or FIRST_NAME  LIKE '%{0}%' or LAST_NAME LIKE '%{0}%'  or EMAIL  LIKE '%{0}%'">
                                    <filterparameters>
                                        <asp:controlparameter controlid="searchBox" propertyname="Text" />
                                    </filterparameters>
                                </asp:SqlDataSource>
                                
                                <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" 
                                    DataKeyNames="USERID" DataSourceID="SqlDataSource3" 
                                    EnableModelValidation="True" AllowPaging="True" AllowSorting="True">
                                    <Columns>
                                        <asp:CommandField ShowSelectButton="True" />
                                        <asp:BoundField DataField="USERID" HeaderText="USERID" InsertVisible="False" 
                                            ReadOnly="True" SortExpression="USERID" />
                                        <asp:BoundField DataField="REGI_DATE" HeaderText="REGI_DATE" 
                                            SortExpression="REGI_DATE" />
                                        <asp:BoundField DataField="COMPANY_NAME" HeaderText="COMPANY_NAME" 
                                            SortExpression="COMPANY_NAME" />
                                        <asp:BoundField DataField="TITLE" HeaderText="TITLE" 
                                            SortExpression="TITLE" />
                                        <asp:BoundField DataField="FIRST_NAME" HeaderText="FIRST_NAME" 
                                            SortExpression="FIRST_NAME" />
                                        <asp:BoundField DataField="LAST_NAME" HeaderText="LAST_NAME" 
                                            SortExpression="LAST_NAME" />
                                        <asp:BoundField DataField="EMAIL" HeaderText="EMAIL" SortExpression="EMAIL" />
                                        <asp:BoundField DataField="BPHONE" HeaderText="BPHONE" 
                                            SortExpression="BPHONE" />
                                        <asp:BoundField DataField="MOBILE" HeaderText="MOBILE" 
                                            SortExpression="MOBILE" />
                                        <asp:BoundField DataField="FAX" HeaderText="FAX" SortExpression="FAX" />
                                        <asp:BoundField DataField="NOTICE_ADDRESS" HeaderText="NOTICE_ADDRESS" 
                                            SortExpression="NOTICE_ADDRESS" />
                                        <asp:BoundField DataField="NOTICE_SUBURB" HeaderText="NOTICE_SUBURB" 
                                            SortExpression="NOTICE_SUBURB" />
                                        <asp:BoundField DataField="NOTICE_STATE" HeaderText="NOTICE_STATE" 
                                            SortExpression="NOTICE_STATE" />
                                        <asp:BoundField DataField="NOTICE_POSTCODE" HeaderText="NOTICE_POSTCODE" 
                                            SortExpression="NOTICE_POSTCODE" />
                                    </Columns>
                                </asp:GridView>
                                <asp:SqlDataSource ID="SqlDataSource5" runat="server" 
                                    ConnectionString="<%$ ConnectionStrings:SQLServer2005DBConnectionString %>" 
                                    SelectCommand="SELECT [USERID], [REGI_DATE], [COMPANY_NAME], [TITLE], [FIRST_NAME], [LAST_NAME], [EMAIL], [BPHONE], [MOBILE], [FAX], [NOTICE_ADDRESS], [NOTICE_SUBURB], [NOTICE_STATE], [NOTICE_POSTCODE] FROM [tblCI] WHERE ([USERID] = @USERID)">
                                    <SelectParameters>
                                        <asp:ControlParameter ControlID="GridView2" Name="USERID" 
                                            PropertyName="SelectedValue" Type="Int32" />
                                    </SelectParameters>
                                </asp:SqlDataSource>
                                <asp:FormView ID="FormView1" runat="server" DataKeyNames="USERID" 
                                    DataSourceID="SqlDataSource5" EnableModelValidation="True">
                                    <EditItemTemplate>
                                        USERID:
                                        <asp:Label ID="USERIDLabel1" runat="server" Text='<%# Eval("USERID") %>' />
                                        <br />
                                        REGI_DATE:
                                        <asp:TextBox ID="REGI_DATETextBox" runat="server" 
                                            Text='<%# Bind("REGI_DATE") %>' />
                                        <br />
                                        COMPANY_NAME:
                                        <asp:TextBox ID="COMPANY_NAMETextBox" runat="server" 
                                            Text='<%# Bind("COMPANY_NAME") %>' />
                                        <br />
                                        TITLE:
                                        <asp:TextBox ID="TITLETextBox" runat="server" Text='<%# Bind("TITLE") %>' />
                                        <br />
                                        FIRST_NAME:
                                        <asp:TextBox ID="FIRST_NAMETextBox" runat="server" 
                                            Text='<%# Bind("FIRST_NAME") %>' />
                                        <br />
                                        LAST_NAME:
                                        <asp:TextBox ID="LAST_NAMETextBox" runat="server" 
                                            Text='<%# Bind("LAST_NAME") %>' />
                                        <br />
                                        EMAIL:
                                        <asp:TextBox ID="EMAILTextBox" runat="server" Text='<%# Bind("EMAIL") %>' />
                                        <br />
                                        BPHONE:
                                        <asp:TextBox ID="BPHONETextBox" runat="server" Text='<%# Bind("BPHONE") %>' />
                                        <br />
                                        MOBILE:
                                        <asp:TextBox ID="MOBILETextBox" runat="server" Text='<%# Bind("MOBILE") %>' />
                                        <br />
                                        FAX:
                                        <asp:TextBox ID="FAXTextBox" runat="server" Text='<%# Bind("FAX") %>' />
                                        <br />
                                        NOTICE_ADDRESS:
                                        <asp:TextBox ID="NOTICE_ADDRESSTextBox" runat="server" 
                                            Text='<%# Bind("NOTICE_ADDRESS") %>' />
                                        <br />
                                        NOTICE_SUBURB:
                                        <asp:TextBox ID="NOTICE_SUBURBTextBox" runat="server" 
                                            Text='<%# Bind("NOTICE_SUBURB") %>' />
                                        <br />
                                        NOTICE_STATE:
                                        <asp:TextBox ID="NOTICE_STATETextBox" runat="server" 
                                            Text='<%# Bind("NOTICE_STATE") %>' />
                                        <br />
                                        NOTICE_POSTCODE:
                                        <asp:TextBox ID="NOTICE_POSTCODETextBox" runat="server" 
                                            Text='<%# Bind("NOTICE_POSTCODE") %>' />
                                        <br />
                                        <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" 
                                            CommandName="Update" Text="Update" />
                                        &nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server" 
                                            CausesValidation="False" CommandName="Cancel" Text="Cancel" />
                                    </EditItemTemplate>
                                    <InsertItemTemplate>
                                        REGI_DATE:
                                        <asp:TextBox ID="REGI_DATETextBox" runat="server" 
                                            Text='<%# Bind("REGI_DATE") %>' />
                                        <br />
                                        COMPANY_NAME:
                                        <asp:TextBox ID="COMPANY_NAMETextBox" runat="server" 
                                            Text='<%# Bind("COMPANY_NAME") %>' />
                                        <br />
                                        TITLE:
                                        <asp:TextBox ID="TITLETextBox" runat="server" Text='<%# Bind("TITLE") %>' />
                                        <br />
                                        FIRST_NAME:
                                        <asp:TextBox ID="FIRST_NAMETextBox" runat="server" 
                                            Text='<%# Bind("FIRST_NAME") %>' />
                                        <br />
                                        LAST_NAME:
                                        <asp:TextBox ID="LAST_NAMETextBox" runat="server" 
                                            Text='<%# Bind("LAST_NAME") %>' />
                                        <br />
                                        EMAIL:
                                        <asp:TextBox ID="EMAILTextBox" runat="server" Text='<%# Bind("EMAIL") %>' />
                                        <br />
                                        BPHONE:
                                        <asp:TextBox ID="BPHONETextBox" runat="server" Text='<%# Bind("BPHONE") %>' />
                                        <br />
                                        MOBILE:
                                        <asp:TextBox ID="MOBILETextBox" runat="server" Text='<%# Bind("MOBILE") %>' />
                                        <br />
                                        FAX:
                                        <asp:TextBox ID="FAXTextBox" runat="server" Text='<%# Bind("FAX") %>' />
                                        <br />
                                        NOTICE_ADDRESS:
                                        <asp:TextBox ID="NOTICE_ADDRESSTextBox" runat="server" 
                                            Text='<%# Bind("NOTICE_ADDRESS") %>' />
                                        <br />
                                        NOTICE_SUBURB:
                                        <asp:TextBox ID="NOTICE_SUBURBTextBox" runat="server" 
                                            Text='<%# Bind("NOTICE_SUBURB") %>' />
                                        <br />
                                        NOTICE_STATE:
                                        <asp:TextBox ID="NOTICE_STATETextBox" runat="server" 
                                            Text='<%# Bind("NOTICE_STATE") %>' />
                                        <br />
                                        NOTICE_POSTCODE:
                                        <asp:TextBox ID="NOTICE_POSTCODETextBox" runat="server" 
                                            Text='<%# Bind("NOTICE_POSTCODE") %>' />
                                        <br />
                                        <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" 
                                            CommandName="Insert" Text="Insert" />
                                        &nbsp;<asp:LinkButton ID="InsertCancelButton" runat="server" 
                                            CausesValidation="False" CommandName="Cancel" Text="Cancel" />
                                    </InsertItemTemplate>
                                    <ItemTemplate>
                                        USERID:
                                        <asp:Label ID="USERIDLabel" runat="server" Text='<%# Eval("USERID") %>' />
                                        <br />
                                        REGI_DATE:
                                        <asp:Label ID="REGI_DATELabel" runat="server" Text='<%# Bind("REGI_DATE") %>' />
                                        <br />
                                        COMPANY_NAME:
                                        <asp:Label ID="COMPANY_NAMELabel" runat="server" 
                                            Text='<%# Bind("COMPANY_NAME") %>' />
                                        <br />
                                        TITLE:
                                        <asp:Label ID="TITLELabel" runat="server" Text='<%# Bind("TITLE") %>' />
                                        <br />
                                        FIRST_NAME:
                                        <asp:Label ID="FIRST_NAMELabel" runat="server" 
                                            Text='<%# Bind("FIRST_NAME") %>' />
                                        <br />
                                        LAST_NAME:
                                        <asp:Label ID="LAST_NAMELabel" runat="server" Text='<%# Bind("LAST_NAME") %>' />
                                        <br />
                                        EMAIL:
                                        <asp:Label ID="EMAILLabel" runat="server" Text='<%# Bind("EMAIL") %>' />
                                        <br />
                                        BPHONE:
                                        <asp:Label ID="BPHONELabel" runat="server" Text='<%# Bind("BPHONE") %>' />
                                        <br />
                                        MOBILE:
                                        <asp:Label ID="MOBILELabel" runat="server" Text='<%# Bind("MOBILE") %>' />
                                        <br />
                                        FAX:
                                        <asp:Label ID="FAXLabel" runat="server" Text='<%# Bind("FAX") %>' />
                                        <br />
                                        NOTICE_ADDRESS:
                                        <asp:Label ID="NOTICE_ADDRESSLabel" runat="server" 
                                            Text='<%# Bind("NOTICE_ADDRESS") %>' />
                                        <br />
                                        NOTICE_SUBURB:
                                        <asp:Label ID="NOTICE_SUBURBLabel" runat="server" 
                                            Text='<%# Bind("NOTICE_SUBURB") %>' />
                                        <br />
                                        NOTICE_STATE:
                                        <asp:Label ID="NOTICE_STATELabel" runat="server" 
                                            Text='<%# Bind("NOTICE_STATE") %>' />
                                        <br />
                                        NOTICE_POSTCODE:
                                        <asp:Label ID="NOTICE_POSTCODELabel" runat="server" 
                                            Text='<%# Bind("NOTICE_POSTCODE") %>' />
                                        <br />
                                        <input type="button" ID="CopyCI" runat="server" value="Copy Customer Details" onclick="CopyCIChanged()"/>
                                    </ItemTemplate>
                                </asp:FormView>

                            </asp:View>
                            <asp:View ID="View2" runat="server">
                                <asp:Panel ID="panSearch2" runat="server" DefaultButton="btnsearch2" Width="100%" >
                
                                        <ASP:TextBox runat="server" type="text" id="searchBox2" Width="250px"/>
                                        <asp:Button ID="btnsearch2" runat="server" Text="Search by FirstName/LastName/Email/CompanyName" />

                                </asp:Panel>  


                                <asp:SqlDataSource ID="SqlDataSource4" runat="server" 
                                    ConnectionString="<%$ ConnectionStrings:SQLServer2005DBConnectionString %>" 
                                    SelectCommand="SELECT [UserID], [CompanyName], [FirstAccountHolderTitle], [FirstName], [LastName], [Email], [Phone], [Mobile], [Fax], [Street], [Suburb], [StateName], [Postcode] FROM [tblUser] ORDER BY [UserID] DESC"

                                    filterexpression="CompanyName LIKE '%{0}%' or FirstName  LIKE '%{0}%' or LastName LIKE '%{0}%'  or Email  LIKE '%{0}%'">
                                    <filterparameters>
                                        <asp:controlparameter controlid="searchBox2" propertyname="Text" />
                                    </filterparameters>
                                </asp:SqlDataSource>


                                <asp:GridView ID="GridView3" runat="server" AutoGenerateColumns="False" 
                                    DataSourceID="SqlDataSource4" EnableModelValidation="True" DataKeyNames="UserID"
                                    AllowPaging="True" AllowSorting="True">
                                    <Columns>
                                        <asp:CommandField ShowSelectButton="True" />
                                        <asp:BoundField DataField="UserID" HeaderText="UserID" 
                                            SortExpression="UserID" />
                                        <asp:BoundField DataField="CompanyName" HeaderText="CompanyName" 
                                            SortExpression="CompanyName" />
                                        <asp:BoundField DataField="FirstAccountHolderTitle" HeaderText="FirstAccountHolderTitle" 
                                            SortExpression="FirstAccountHolderTitle" />
                                        <asp:BoundField DataField="FirstName" HeaderText="FirstName" 
                                            SortExpression="FirstName" />
                                        <asp:BoundField DataField="LastName" HeaderText="LastName" 
                                            SortExpression="LastName" />
                                        <asp:BoundField DataField="Email" HeaderText="Email" SortExpression="Email" />
                                        <asp:BoundField DataField="Phone" HeaderText="Phone" SortExpression="Phone" />
                                        <asp:BoundField DataField="Mobile" HeaderText="Mobile" 
                                            SortExpression="Mobile" />
                                        <asp:BoundField DataField="Fax" HeaderText="Fax" SortExpression="Fax" />
                                        <asp:BoundField DataField="Street" HeaderText="Street" 
                                            SortExpression="Street" />
                                        <asp:BoundField DataField="Suburb" HeaderText="Suburb" 
                                            SortExpression="Suburb" />
                                        <asp:BoundField DataField="StateName" HeaderText="StateName" 
                                            SortExpression="StateName" />
                                        <asp:BoundField DataField="Postcode" HeaderText="Postcode" 
                                            SortExpression="Postcode" />
                                    </Columns>
                                </asp:GridView>

                                <asp:SqlDataSource ID="SqlDataSource6" runat="server" 
                                    ConnectionString="<%$ ConnectionStrings:SQLServer2005DBConnectionString %>" 
                                    SelectCommand="SELECT [UserID], [CompanyName], [FirstAccountHolderTitle], [FirstName], [LastName], [Email], [Phone], [Mobile], [Fax], [Street], [Suburb], [StateName], [Postcode] FROM [tblUser] WHERE ([UserID] = @UserID)">
                                    <SelectParameters>
                                        <asp:ControlParameter ControlID="GridView3" Name="UserID" 
                                            PropertyName="SelectedValue" Type="Int32" />
                                    </SelectParameters>
                                </asp:SqlDataSource>
                                <asp:FormView ID="FormView2" runat="server" DataSourceID="SqlDataSource6" 
                                    EnableModelValidation="True">
                                    <EditItemTemplate>
                                        UserID:
                                        <asp:TextBox ID="UserIDTextBox" runat="server" Text='<%# Bind("UserID") %>' />
                                        <br />
                                        CompanyName:
                                        <asp:TextBox ID="CompanyNameTextBox" runat="server" 
                                            Text='<%# Bind("CompanyName") %>' />
                                        <br />
                                        FirstAccountHolderTitle:
                                        <asp:TextBox ID="FirstAccountHolderTitleTextBox" runat="server" 
                                            Text='<%# Bind("FirstAccountHolderTitle") %>' />
                                        <br />
                                        FirstName:
                                        <asp:TextBox ID="FirstNameTextBox" runat="server" 
                                            Text='<%# Bind("FirstName") %>' />
                                        <br />
                                        LastName:
                                        <asp:TextBox ID="LastNameTextBox" runat="server" 
                                            Text='<%# Bind("LastName") %>' />
                                        <br />
                                        Email:
                                        <asp:TextBox ID="EmailTextBox" runat="server" Text='<%# Bind("Email") %>' />
                                        <br />
                                        Phone:
                                        <asp:TextBox ID="PhoneTextBox" runat="server" Text='<%# Bind("Phone") %>' />
                                        <br />
                                        Mobile:
                                        <asp:TextBox ID="MobileTextBox" runat="server" Text='<%# Bind("Mobile") %>' />
                                        <br />
                                        Fax:
                                        <asp:TextBox ID="FaxTextBox" runat="server" Text='<%# Bind("Fax") %>' />
                                        <br />
                                        Street:
                                        <asp:TextBox ID="StreetTextBox" runat="server" Text='<%# Bind("Street") %>' />
                                        <br />
                                        Suburb:
                                        <asp:TextBox ID="SuburbTextBox" runat="server" Text='<%# Bind("Suburb") %>' />
                                        <br />
                                        StateName:
                                        <asp:TextBox ID="StateNameTextBox" runat="server" 
                                            Text='<%# Bind("StateName") %>' />
                                        <br />
                                        Postcode:
                                        <asp:TextBox ID="PostcodeTextBox" runat="server" 
                                            Text='<%# Bind("Postcode") %>' />
                                        <br />
                                        <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" 
                                            CommandName="Update" Text="Update" />
                                        &nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server" 
                                            CausesValidation="False" CommandName="Cancel" Text="Cancel" />
                                    </EditItemTemplate>
                                    <InsertItemTemplate>
                                        UserID:
                                        <asp:TextBox ID="UserIDTextBox" runat="server" Text='<%# Bind("UserID") %>' />
                                        <br />
                                        CompanyName:
                                        <asp:TextBox ID="CompanyNameTextBox" runat="server" 
                                            Text='<%# Bind("CompanyName") %>' />
                                        <br />
                                        FirstAccountHolderTitle:
                                        <asp:TextBox ID="FirstAccountHolderTitleTextBox" runat="server" 
                                            Text='<%# Bind("FirstAccountHolderTitle") %>' />
                                        <br />
                                        FirstName:
                                        <asp:TextBox ID="FirstNameTextBox" runat="server" 
                                            Text='<%# Bind("FirstName") %>' />
                                        <br />
                                        LastName:
                                        <asp:TextBox ID="LastNameTextBox" runat="server" 
                                            Text='<%# Bind("LastName") %>' />
                                        <br />
                                        Email:
                                        <asp:TextBox ID="EmailTextBox" runat="server" Text='<%# Bind("Email") %>' />
                                        <br />
                                        Phone:
                                        <asp:TextBox ID="PhoneTextBox" runat="server" Text='<%# Bind("Phone") %>' />
                                        <br />
                                        Mobile:
                                        <asp:TextBox ID="MobileTextBox" runat="server" Text='<%# Bind("Mobile") %>' />
                                        <br />
                                        Fax:
                                        <asp:TextBox ID="FaxTextBox" runat="server" Text='<%# Bind("Fax") %>' />
                                        <br />
                                        Street:
                                        <asp:TextBox ID="StreetTextBox" runat="server" Text='<%# Bind("Street") %>' />
                                        <br />
                                        Suburb:
                                        <asp:TextBox ID="SuburbTextBox" runat="server" Text='<%# Bind("Suburb") %>' />
                                        <br />
                                        StateName:
                                        <asp:TextBox ID="StateNameTextBox" runat="server" 
                                            Text='<%# Bind("StateName") %>' />
                                        <br />
                                        Postcode:
                                        <asp:TextBox ID="PostcodeTextBox" runat="server" 
                                            Text='<%# Bind("Postcode") %>' />
                                        <br />
                                        <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" 
                                            CommandName="Insert" Text="Insert" />
                                        &nbsp;<asp:LinkButton ID="InsertCancelButton" runat="server" 
                                            CausesValidation="False" CommandName="Cancel" Text="Cancel" />
                                    </InsertItemTemplate>
                                    <ItemTemplate>
                                        UserID:
                                        <asp:Label ID="UserIDLabel" runat="server" Text='<%# Bind("UserID") %>' />
                                        <br />
                                        CompanyName:
                                        <asp:Label ID="CompanyNameLabel" runat="server" 
                                            Text='<%# Bind("CompanyName") %>' />
                                        <br />
                                        FirstAccountHolderTitle:
                                        <asp:Label ID="FirstAccountHolderTitleLabel" runat="server" 
                                            Text='<%# Bind("FirstAccountHolderTitle") %>' />
                                        <br />
                                        FirstName:
                                        <asp:Label ID="FirstNameLabel" runat="server" Text='<%# Bind("FirstName") %>' />
                                        <br />
                                        LastName:
                                        <asp:Label ID="LastNameLabel" runat="server" Text='<%# Bind("LastName") %>' />
                                        <br />
                                        Email:
                                        <asp:Label ID="EmailLabel" runat="server" Text='<%# Bind("Email") %>' />
                                        <br />
                                        Phone:
                                        <asp:Label ID="PhoneLabel" runat="server" Text='<%# Bind("Phone") %>' />
                                        <br />
                                        Mobile:
                                        <asp:Label ID="MobileLabel" runat="server" Text='<%# Bind("Mobile") %>' />
                                        <br />
                                        Fax:
                                        <asp:Label ID="FaxLabel" runat="server" Text='<%# Bind("Fax") %>' />
                                        <br />
                                        Street:
                                        <asp:Label ID="StreetLabel" runat="server" Text='<%# Bind("Street") %>' />
                                        <br />
                                        Suburb:
                                        <asp:Label ID="SuburbLabel" runat="server" Text='<%# Bind("Suburb") %>' />
                                        <br />
                                        StateName:
                                        <asp:Label ID="StateNameLabel" runat="server" Text='<%# Bind("StateName") %>' />
                                        <br />
                                        Postcode:
                                        <asp:Label ID="PostcodeLabel" runat="server" Text='<%# Bind("Postcode") %>' />
                                        <br />
                                        <input type="button" ID="ButtonCopyRS" runat="server" value="Copy Customer Details" onclick="CopyRSChanged()"/>
                                    </ItemTemplate>
                                </asp:FormView>
                            </asp:View>
                        </asp:MultiView>


                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label3" runat="server" Text='<%# Bind("ID_TYPE") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>

                <asp:TemplateField HeaderText="USERID" SortExpression="USERID">
                    <EditItemTemplate>
                        <asp:TextBox ID="USERID" runat="server" Text='<%# Bind("USERID") %>'></asp:TextBox>

                            <asp:SqlDataSource ID="SqlDataSource13" runat="server" 
                                ConnectionString="<%$ ConnectionStrings:SQLServer2005DBConnectionString %>" 
                                SelectCommand="SELECT [NMI], [MIRN], [DateConverted], [SourceCode], [ProductType] FROM [tblUser] WHERE ([UserID] = @UserID)">
                                <SelectParameters>
                                    <asp:ControlParameter ControlID="USERID" Name="UserID" PropertyName="Text" 
                                        Type="Int32" />
                                </SelectParameters>
                            </asp:SqlDataSource>
                            <asp:FormView ID="FormView3" runat="server" DataSourceID="SqlDataSource13" 
                                EnableModelValidation="True">

                                <ItemTemplate>

                                    <table>
                                        <tr>
                                            <td>Date Converted
                                            </td>
                                            <td><asp:Label ID="DateConvertedLabel" runat="server" 
                                        Text='<%# Bind("DateConverted") %>' />
                                            </td>
                                        
                                        </tr>
                                        <tr>
                                            <td>Product Type
                                            </td>
                                            <td><asp:Label ID="ProductTypeLabel" runat="server" 
                                        Text='<%# Bind("ProductType") %>' />
                                            </td>
                                        
                                        </tr>
                                        <tr>
                                            <td>Source Code
                                            </td>
                                            <td><asp:Label ID="SourceCodeLabel" runat="server" 
                                        Text='<%# Bind("SourceCode") %>' />
                                            </td>
                                        
                                        </tr>
                                        <tr>
                                            <td>NMI
                                            </td>
                                            <td><asp:Label ID="NMILabel" runat="server" Text='<%# Bind("NMI") %>' />
                                            </td>
                                        
                                        </tr>
                                        <tr>
                                            <td>MIRN
                                            </td>
                                            <td><asp:Label ID="MIRNLabel" runat="server" Text='<%# Bind("MIRN") %>' />
                                            </td>
                                        
                                        </tr>
                                        
                                        
                                        
                                    
                                    
                                    </table>
                                    

                                </ItemTemplate>
                            </asp:FormView>

                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:TextBox ID="USERID" runat="server" Text='<%# Bind("USERID") %>'></asp:TextBox>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="USERID" runat="server" Text='<%# Bind("USERID") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>



                <asp:TemplateField HeaderText="Contact Detail">
                    <EditItemTemplate>
                        <table border="1">
                            <tr>
                                <td>Title</td>
                                <td><asp:TextBox ID="TITLE" runat="server" Text='<%# Bind("TITLE") %>'></asp:TextBox>
                                </td>
                                <td>Email</td>
                                <td><asp:TextBox ID="EMAIL" runat="server" Text='<%# Bind("EMAIL") %>'></asp:TextBox>
                                </td>
                                <td>Street</td>
                                <td><asp:TextBox ID="ADDRESS" runat="server" Text='<%# Bind("ADDRESS") %>'></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>First Name</td>
                                <td><asp:TextBox ID="FIRSTNAME" runat="server" Text='<%# Bind("FIRSTNAME") %>'></asp:TextBox>
                                </td>
                                <td>Business Phone</td>
                                <td><asp:TextBox ID="PHONE" runat="server" Text='<%# Bind("PHONE") %>'></asp:TextBox>
                                </td>
                                <td>Suburb</td>
                                <td><asp:TextBox ID="SUBURB" runat="server" Text='<%# Bind("SUBURB") %>'></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>Last Name</td>
                                <td><asp:TextBox ID="LASTNAME" runat="server" Text='<%# Bind("LASTNAME") %>'></asp:TextBox>
                                </td>
                                <td>Mobile Phone</td>
                                <td><asp:TextBox ID="MOBILE" runat="server" Text='<%# Bind("MOBILE") %>'></asp:TextBox>
                                </td>
                                <td>State</td>
                                <td><asp:TextBox ID="STATE" runat="server" Text='<%# Bind("STATE") %>'></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>Company Name</td>
                                <td><asp:TextBox ID="COMPANY_NAME" runat="server" Text='<%# Bind("COMPANY_NAME") %>'></asp:TextBox>
                                </td>
                                <td>Fax</td>
                                <td><asp:TextBox ID="FAX" runat="server" Text='<%# Bind("FAX") %>'></asp:TextBox>
                                </td>
                                <td>Postcode</td>
                                <td><asp:TextBox ID="POSTCODE" runat="server" Text='<%# Bind("POSTCODE") %>'></asp:TextBox>
                                </td>
                            </tr>
                        </table>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <table border="1">
                            <tr>
                                <td>Title</td>
                                <td><asp:Label ID="TITLE" runat="server" Text='<%# Bind("TITLE") %>'></asp:Label>
                                </td>
                                <td>Email</td>
                                <td><asp:Label ID="EMAIL" runat="server" Text='<%# Bind("EMAIL") %>'></asp:Label>
                                </td>
                                <td>Street</td>
                                <td><asp:Label ID="ADDRESS" runat="server" Text='<%# Bind("ADDRESS") %>'></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td>First Name</td>
                                <td><asp:Label ID="FIRSTNAME" runat="server" Text='<%# Bind("FIRSTNAME") %>'></asp:Label>
                                </td>
                                <td>Business Phone</td>
                                <td><asp:Label ID="PHONE" runat="server" Text='<%# Bind("PHONE") %>'></asp:Label>
                                </td>
                                <td>Suburb</td>
                                <td><asp:Label ID="SUBURB" runat="server" Text='<%# Bind("SUBURB") %>'></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td>Last Name</td>
                                <td><asp:Label ID="LASTNAME" runat="server" Text='<%# Bind("LASTNAME") %>'></asp:Label>
                                </td>
                                <td>Mobile Phone</td>
                                <td><asp:Label ID="MOBILE" runat="server" Text='<%# Bind("MOBILE") %>'></asp:Label>
                                </td>
                                <td>State</td>
                                <td><asp:Label ID="STATE" runat="server" Text='<%# Bind("STATE") %>'></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td>Company Name</td>
                                <td><asp:Label ID="COMPANY_NAME" runat="server" Text='<%# Bind("COMPANY_NAME") %>'></asp:Label>
                                </td>
                                <td>Fax</td>
                                <td><asp:Label ID="FAX" runat="server" Text='<%# Bind("FAX") %>'></asp:Label>
                                </td>
                                <td>Postcode</td>
                                <td><asp:Label ID="POSTCODE" runat="server" Text='<%# Bind("POSTCODE") %>'></asp:Label>
                                </td>
                            </tr>
                        </table>

                            <asp:SqlDataSource ID="SqlDataSource13" runat="server" 
                                ConnectionString="<%$ ConnectionStrings:SQLServer2005DBConnectionString %>" 
                                SelectCommand="SELECT [NMI], [MIRN], [DateConverted], [SourceCode], [ProductType] FROM [tblUser] WHERE ([UserID] = @UserID)">
                                <SelectParameters>
                                    <asp:ControlParameter ControlID="USERID" Name="USERID" PropertyName="Text" 
                                        Type="Int32" />
                                </SelectParameters>
                            </asp:SqlDataSource>
                            <asp:FormView ID="FormView3" runat="server" DataSourceID="SqlDataSource13" 
                                EnableModelValidation="True">

                                <ItemTemplate>

                                    <table>
                                        <tr>
                                            <td>Date Converted
                                            </td>
                                            <td><asp:Label ID="DateConvertedLabel" runat="server" 
                                        Text='<%# Bind("DateConverted") %>' />
                                            </td>
                                        
                                        </tr>
                                        <tr>
                                            <td>Product Type
                                            </td>
                                            <td><asp:Label ID="ProductTypeLabel" runat="server" 
                                        Text='<%# Bind("ProductType") %>' />
                                            </td>
                                        
                                        </tr>
                                        <tr>
                                            <td>Source Code
                                            </td>
                                            <td><asp:Label ID="SourceCodeLabel" runat="server" 
                                        Text='<%# Bind("SourceCode") %>' />
                                            </td>
                                        
                                        </tr>
                                        <tr>
                                            <td>NMI
                                            </td>
                                            <td><asp:Label ID="NMILabel" runat="server" Text='<%# Bind("NMI") %>' />
                                            </td>
                                        
                                        </tr>
                                        <tr>
                                            <td>MIRN
                                            </td>
                                            <td><asp:Label ID="MIRNLabel" runat="server" Text='<%# Bind("MIRN") %>' />
                                            </td>
                                        
                                        </tr>
                                        
                                        
                                        
                                    
                                    
                                    </table>
                                    

                                </ItemTemplate>
                            </asp:FormView>

                    </ItemTemplate>
                    <InsertItemTemplate>
                        <table border="1">
                            <tr>
                                <td>Title</td>
                                <td><asp:TextBox ID="TITLE" runat="server" Text='<%# Bind("TITLE") %>'></asp:TextBox>
                                </td>
                                <td>Email</td>
                                <td><asp:TextBox ID="EMAIL" runat="server" Text='<%# Bind("EMAIL") %>'></asp:TextBox>
                                </td>
                                <td>Street</td>
                                <td><asp:TextBox ID="ADDRESS" runat="server" Text='<%# Bind("ADDRESS") %>'></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>First Name</td>
                                <td><asp:TextBox ID="FIRSTNAME" runat="server" Text='<%# Bind("FIRSTNAME") %>'></asp:TextBox>
                                </td>
                                <td>Business Phone</td>
                                <td><asp:TextBox ID="PHONE" runat="server" Text='<%# Bind("PHONE") %>'></asp:TextBox>
                                </td>
                                <td>Suburb</td>
                                <td><asp:TextBox ID="SUBURB" runat="server" Text='<%# Bind("SUBURB") %>'></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>Last Name</td>
                                <td><asp:TextBox ID="LASTNAME" runat="server" Text='<%# Bind("LASTNAME") %>'></asp:TextBox>
                                </td>
                                <td>Mobile Phone</td>
                                <td><asp:TextBox ID="MOBILE" runat="server" Text='<%# Bind("MOBILE") %>'></asp:TextBox>
                                </td>
                                <td>State</td>
                                <td><asp:TextBox ID="STATE" runat="server" Text='<%# Bind("STATE") %>'></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>Company Name</td>
                                <td><asp:TextBox ID="COMPANY_NAME" runat="server" Text='<%# Bind("COMPANY_NAME") %>'></asp:TextBox>
                                </td>
                                <td>Fax</td>
                                <td><asp:TextBox ID="FAX" runat="server" Text='<%# Bind("FAX") %>'></asp:TextBox>
                                </td>
                                <td>Postcode</td>
                                <td><asp:TextBox ID="POSTCODE" runat="server" Text='<%# Bind("POSTCODE") %>'></asp:TextBox>
                                </td>
                            </tr>
                        </table>
                    
                    </InsertItemTemplate>
                </asp:TemplateField>
   
                <asp:TemplateField HeaderText="Feedback Details" SortExpression="FEED_TYPE">
                    <EditItemTemplate>
                        <asp:DropDownList ID="FEED_TYPE" runat="server" SelectedValue='<%# Bind("FEED_TYPE") %>'
                        onchange="FEED_TYPEChanged('FEED_TYPE_div',this.id)">
                            <asp:ListItem Value="">-Select One-</asp:ListItem>
                            <asp:ListItem Value="Complaint">Complaint</asp:ListItem>
                            <asp:ListItem Value="Compliment">Compliment</asp:ListItem>
                            <asp:ListItem Value="General Feedback">General Feedback</asp:ListItem>
                        </asp:DropDownList>
                        <div id="FEED_TYPE_div">
                            <table>
                            <tr style="visibility:hidden;">
                                <td>Related Department
                                </td>
                                <td>
                                    <asp:DropDownList ID="FEED_DEPART" runat="server" SelectedValue='<%# Bind("FEED_DEPART") %>'   OnDataBound="Sel_Bound">
                                        <asp:ListItem Value="">-Select One-</asp:ListItem>
                                        <asp:ListItem>None</asp:ListItem>
                                         <asp:ListItem>TeleFields</asp:ListItem>
                                        
                                    </asp:DropDownList>

                                </td>
                            </tr>
                            <tr>
                                <td>Source
                                </td>
                                <td>
                                    <asp:DropDownList ID="FEED_MODE" runat="server" SelectedValue='<%# Bind("FEED_SOURCE") %>' >
                                        <asp:ListItem Value="">-Select One-</asp:ListItem>
                                        <asp:ListItem>Phone</asp:ListItem>
                                        <asp:ListItem>Written</asp:ListItem>
                                        <asp:ListItem>Email</asp:ListItem>
                                        <asp:ListItem>Web</asp:ListItem>
                                        
                                    </asp:DropDownList>
                                </td>
                            </tr>
                            <tr>
                                <td>Priority
                                </td>
                                <td>
                                    <asp:DropDownList ID="FEED_PRIORITY" runat="server" SelectedValue='<%# Bind("FEED_PRIORITY") %>'   OnDataBound="Sel_Bound">
                                        <asp:ListItem Value="">-Select One-</asp:ListItem>
                                        <asp:ListItem>None</asp:ListItem>
                                        <asp:ListItem>Low</asp:ListItem>
                                        <asp:ListItem>Medium</asp:ListItem>
                                        <asp:ListItem>High</asp:ListItem>
                                        <asp:ListItem>Extreme</asp:ListItem>
                                        
                                    </asp:DropDownList>
                                </td>
                            </tr>
                            <tr>
                                <td>Related Issue
                                </td>
                                <td>
                                    <asp:TextBox ID="ttbFEED_ISSUE" runat="server" Text='<%# Bind("FEED_ISSUE") %>'></asp:TextBox>
                                    <asp:DropDownList ID="selFEED_ISSUE" runat="server" 
                                        DataSourceID="SqlDataSource7" 
                                        DataTextField="about" DataValueField="about"  OnDataBound="Sel_Bound"  onchange="selFEED_ISSUEChanged()">
                                    </asp:DropDownList>

                                    <asp:SqlDataSource ID="SqlDataSource7" runat="server" 
                                        ConnectionString="<%$ ConnectionStrings:SQLServer2005DBConnectionString %>" 
                                        SelectCommand="SELECT DISTINCT [id], [about] FROM [tblFeedback_About] ORDER BY [id]">
                                    </asp:SqlDataSource>
                                        

                                </td>
                            </tr>
                            <tr>
                                <td>Subject
                                </td>
                                <td>
                                    <asp:TextBox ID="FEED_SUBJECT" runat="server" Text='<%# Bind("FEED_SUBJECT") %>'  Width="250px"></asp:TextBox>
                                </td>
                            </tr>

                            <tr>
                                <td>Related Partner
                                </td>
                                <td>
                                    <asp:DropDownList ID="FEED_PARTNER" runat="server" SelectedValue='<%# Bind("FEED_PARTNER") %>'  OnDataBound="Sel_Bound">
                                        <asp:ListItem Value="">-Select One-</asp:ListItem>
                                        <asp:ListItem>None</asp:ListItem>
                                
                                        <asp:ListItem>Energy Australia</asp:ListItem>
                                        <asp:ListItem>BlueNRG</asp:ListItem>
                                        <asp:ListItem>ERMPower</asp:ListItem>
                                        <asp:ListItem>Alinta Energy</asp:ListItem>
                                        <asp:ListItem>Sydney Office</asp:ListItem>
                                        <asp:ListItem>TeleFields</asp:ListItem>
                                        <asp:ListItem>Manila</asp:ListItem>
                                      
                                       
                                    </asp:DropDownList>
                                </td>
                            </tr>
                            <tr>
                                <td>Resolved?
                                </td>
                                <td>
                                    <asp:DropDownList ID="FEED_SOLVED" runat="server" SelectedValue='<%# Bind("FEED_SOLVED") %>' 
                                    onchange="FEED_SOLVEDChanged('FEED_SOLVED_div',this.id)"  OnDataBound="Sel_Bound">
                                        <asp:ListItem Value="">-Select One-</asp:ListItem>
                                        <asp:ListItem>None</asp:ListItem>
                                        <asp:ListItem>unresolved</asp:ListItem>
                                        <asp:ListItem>resolved</asp:ListItem>
                                        
                                    </asp:DropDownList>
                                    <div id="FEED_SOLVED_div">
                                        Date:<asp:TextBox ID="FEED_SOLVED_DATE" runat="server" 
                            Text='<%# Bind("FEED_SOLVED_DATE") %>'  onclick="WdatePicker()"></asp:TextBox>
                                    </div>

                                </td>
                            </tr>
                            <tr>
                                <td>Escalate?
                                </td>
                                <td>
                                    <asp:DropDownList ID="FEED_ESCALATE" runat="server" SelectedValue='<%# Bind("FEED_ESCALATE") %>' 
                                    onchange="FEED_ESCALATEChanged('FEED_ESCALATE_div',this.id)">
                                        <asp:ListItem>No</asp:ListItem>
                                        <asp:ListItem>Yes</asp:ListItem>
                                        
                                        <asp:ListItem Value="">-Select One-</asp:ListItem>
                                    </asp:DropDownList>
                                    <div id="FEED_ESCALATE_div">
                                        Date:<asp:TextBox ID="FEED_ESCALATE_DATE" runat="server" 
                            Text='<%# Bind("FEED_ESCALATE_DATE") %>'  onclick="WdatePicker()"></asp:TextBox><br/>
                            Assign To: 
                                        <asp:DropDownList ID="FEED_ASSIGN" runat="server" SelectedValue='<%# Bind("FEED_ASSIGN") %>'  OnDataBound="Sel_Bound">
                                            <asp:ListItem Value="">-Select One-</asp:ListItem> 
                                            <asp:ListItem>None</asp:ListItem>
                                            <asp:ListItem>Samantha Davies</asp:ListItem>
                                            <asp:ListItem>Kelvin Wiggins</asp:ListItem>
                                            <asp:ListItem>Daven Bettridge</asp:ListItem>
                                              <asp:ListItem>Orson Gilmore</asp:ListItem>
                                        <asp:ListItem>Vic Sandhu</asp:ListItem>
                                        <asp:ListItem>Sales Won</asp:ListItem>
                                           
                                        </asp:DropDownList>
                                    </div>

                                </td>
                            </tr>
                            <tr>
                                <td>Contact Ombudsman?
                                </td>
                                <td>
                                    <asp:DropDownList ID="OMEN_HAS" runat="server" SelectedValue='<%# Bind("OMEN_HAS") %>' 
                                    onchange="OMEN_HASChanged('OMEN_HAS_div',this.id)">
                                        <asp:ListItem>No</asp:ListItem>
                                        <asp:ListItem>Yes</asp:ListItem>
                                        
                                        <asp:ListItem Value="">-Select One-</asp:ListItem>
                                    </asp:DropDownList>
                                    <div id="OMEN_HAS_div">
                                        OMEN_ID:<asp:TextBox ID="OMEN_ID" runat="server" 
                            Text='<%# Bind("OMEN_ID") %>'></asp:TextBox>
                                    </div>

                                </td>
                            </tr>

                            </table>

                    </EditItemTemplate>
                    <InsertItemTemplate>

                        <asp:DropDownList ID="FEED_TYPE" runat="server" SelectedValue='<%# Bind("FEED_TYPE") %>'
                        onchange="FEED_TYPEChanged('FEED_TYPE_div',this.id)">
                            <asp:ListItem Value="">-Select One-</asp:ListItem>
                            <asp:ListItem Value="Complaint">Complaint</asp:ListItem>
                            <asp:ListItem Value="Compliment">Compliment</asp:ListItem>
                            <asp:ListItem Value="General Feedback">General Feedback</asp:ListItem>
                        </asp:DropDownList>

                        <div id="FEED_TYPE_div">
                            <table>

                            <tr style="visibility:hidden;">
                                <td>Related Department
                                </td>
                                <td>


                                    <asp:DropDownList ID="FEED_DEPART" runat="server" SelectedValue='<%# Bind("FEED_DEPART") %>'   OnDataBound="Sel_Bound">
                                        <asp:ListItem Value="">-Select One-</asp:ListItem>
                                        <asp:ListItem>None</asp:ListItem>
                                        <asp:ListItem>TeleFields</asp:ListItem>
                                        
                                        
                                    </asp:DropDownList>

                                </td>
                            </tr>
                            <tr>
                                <td>Source
                                </td>
                                <td>
                                    <asp:DropDownList ID="FEED_MODE" runat="server" SelectedValue='<%# Bind("FEED_SOURCE") %>' >
                                        <asp:ListItem Value="">-Select One-</asp:ListItem>
                                        <asp:ListItem>Phone</asp:ListItem>
                                        <asp:ListItem>Written</asp:ListItem>
                                        <asp:ListItem>Email</asp:ListItem>
                                        <asp:ListItem>Web</asp:ListItem>
                                        
                                    </asp:DropDownList>
                                </td>
                            </tr>
                            <tr>
                                <td>Priority
                                </td>
                                <td>
                                    <asp:DropDownList ID="FEED_PRIORITY" runat="server" SelectedValue='<%# Bind("FEED_PRIORITY") %>'  OnDataBound="Sel_Bound">
                                        <asp:ListItem Value="">-Select One-</asp:ListItem>
                                        <asp:ListItem>None</asp:ListItem>
                                        <asp:ListItem>Low</asp:ListItem>
                                        <asp:ListItem>Medium</asp:ListItem>
                                        <asp:ListItem>High</asp:ListItem>
                                        <asp:ListItem>Extreme</asp:ListItem>
                                        
                                    </asp:DropDownList>
                                </td>
                            </tr>
                            <tr>
                                <td>Related Issue
                                </td>
                                <td>
                                    <asp:TextBox ID="ttbFEED_ISSUE" runat="server" Text='<%# Bind("FEED_ISSUE") %>'></asp:TextBox>
                                    <asp:DropDownList ID="selFEED_ISSUE" runat="server" 
                                        DataSourceID="SqlDataSource7" 
                                        DataTextField="about" DataValueField="about"  OnDataBound="Sel_Bound"  onchange="selFEED_ISSUEChanged()">
                                    </asp:DropDownList>

                                    <asp:SqlDataSource ID="SqlDataSource7" runat="server" 
                                        ConnectionString="<%$ ConnectionStrings:SQLServer2005DBConnectionString %>" 
                                        SelectCommand="SELECT DISTINCT [id], [about] FROM [tblFeedback_About] ORDER BY [id]">
                                    </asp:SqlDataSource>
                                        

                                </td>
                            </tr>
                            <tr>
                                <td>Subject
                                </td>
                                <td>
                                    <asp:TextBox ID="FEED_SUBJECT" runat="server" Text='<%# Bind("FEED_SUBJECT") %>' Width="250px"></asp:TextBox>
                                </td>
                            </tr>

                            <tr>
                                <td>Related Partner
                                </td>
                                <td>
                                    <asp:DropDownList ID="FEED_PARTNER" runat="server" SelectedValue='<%# Bind("FEED_PARTNER") %>'  OnDataBound="Sel_Bound">
                                        <asp:ListItem Value="">-Select One-</asp:ListItem>
                                        <asp:ListItem>None</asp:ListItem>
                          
                                        <asp:ListItem>Energy Australia</asp:ListItem>
                                        <asp:ListItem>BlueNRG</asp:ListItem>
                                        <asp:ListItem>ERMPower</asp:ListItem>
                                        <asp:ListItem>Alinta Energy</asp:ListItem>
                                        <asp:ListItem>Sydney Office</asp:ListItem>
                                        <asp:ListItem>TeleFields</asp:ListItem>
                                        <asp:ListItem>Manila</asp:ListItem>
                                        

                                       
                                    </asp:DropDownList>

                                </td>
                            </tr>
                            <tr>
                                <td>Resolved?
                                </td>
                                <td>
                                    <asp:DropDownList ID="FEED_SOLVED" runat="server" SelectedValue='<%# Bind("FEED_SOLVED") %>' 
                                    onchange="FEED_SOLVEDChanged('FEED_SOLVED_div',this.id)"  OnDataBound="Sel_Bound">
                                        <asp:ListItem Value="">-Select One-</asp:ListItem>
                                        <asp:ListItem>None</asp:ListItem>
                                        <asp:ListItem>unresolved</asp:ListItem>
                                        <asp:ListItem>resolved</asp:ListItem>
                                        
                                    </asp:DropDownList>
                                    <div id="FEED_SOLVED_div">
                                        Date:<asp:TextBox ID="FEED_SOLVED_DATE" runat="server" 
                            Text='<%# Bind("FEED_SOLVED_DATE") %>'  onclick="WdatePicker()"></asp:TextBox>
                                    </div>

                                </td>
                            </tr>
                            <tr>
                                <td>Escalate?
                                </td>
                                <td>
                                    <asp:DropDownList ID="FEED_ESCALATE" runat="server" SelectedValue='<%# Bind("FEED_ESCALATE") %>' 
                                    onchange="FEED_ESCALATEChanged('FEED_ESCALATE_div',this.id)">
                                        <asp:ListItem>No</asp:ListItem>
                                        <asp:ListItem>Yes</asp:ListItem>
                                        
                                        <asp:ListItem Value="">-Select One-</asp:ListItem>
                                    </asp:DropDownList>
                                    <div id="FEED_ESCALATE_div">
                                        Date:<asp:TextBox ID="FEED_ESCALATE_DATE" runat="server" 
                            Text='<%# Bind("FEED_ESCALATE_DATE") %>'  onclick="WdatePicker()"></asp:TextBox><br/>
                            Assign To: 
                                        <asp:DropDownList ID="FEED_ASSIGN" runat="server" SelectedValue='<%# Bind("FEED_ASSIGN") %>'  OnDataBound="Sel_Bound">
                                            <asp:ListItem Value="">-Select One-</asp:ListItem>
                                            <asp:ListItem>None</asp:ListItem>
                                            <asp:ListItem>Samantha Davies</asp:ListItem>
                                            <asp:ListItem>Kelvin Wiggins</asp:ListItem>
                                            <asp:ListItem>Daven Bettridge</asp:ListItem>
                                            <asp:ListItem>Orson Gilmore</asp:ListItem>
                                        <asp:ListItem>Vic Sandhu</asp:ListItem>
                                        <asp:ListItem>Sales Won</asp:ListItem>
                                            
                                        </asp:DropDownList>
                                    </div>

                                </td>
                            </tr>
                            <tr>
                                <td>Contact Ombudsman?
                                </td>
                                <td>
                                    <asp:DropDownList ID="OMEN_HAS" runat="server" SelectedValue='<%# Bind("OMEN_HAS") %>' 
                                    onchange="OMEN_HASChanged('OMEN_HAS_div',this.id)">
                                        <asp:ListItem>No</asp:ListItem>
                                        <asp:ListItem>Yes</asp:ListItem>
                                        <asp:ListItem Value="">-Select One-</asp:ListItem>
                                    </asp:DropDownList>
                                    <div id="OMEN_HAS_div">
                                        OMEN_ID:<asp:TextBox ID="OMEN_ID" runat="server" 
                            Text='<%# Bind("OMEN_ID") %>'></asp:TextBox>
                                    </div>

                                </td>
                            </tr>

                            </table>


                    </InsertItemTemplate>
                    <ItemTemplate>


                    </ItemTemplate>
                </asp:TemplateField>
                <asp:CommandField ShowEditButton="True" ShowInsertButton="True" />
                <asp:TemplateField HeaderText="Comment History">

                                    <EditItemTemplate>
                                        <asp:SqlDataSource ID="SqlDataSource8" runat="server" 
                        ConnectionString="<%$ ConnectionStrings:SQLServer2005DBConnectionString %>" 
                        DeleteCommand="DELETE FROM [tblTicket_Comment] WHERE [ID] = @ID" 
                        InsertCommand="INSERT INTO [tblTicket_Comment] ([CFID], [OPERATOR], [DATE], [COMMENT]) VALUES (@CFID, @OPERATOR, @DATE, @COMMENT)" 
                        SelectCommand="SELECT * FROM [tblTicket_Comment] WHERE ([CFID] = @CFID)" 
                        UpdateCommand="UPDATE [tblTicket_Comment] SET  [DATE] = @DATE, [COMMENT] = @COMMENT WHERE [ID] = @ID">
                        <DeleteParameters>
                            <asp:Parameter Name="ID" Type="Int32" />
                        </DeleteParameters>
                        <InsertParameters>
                            <asp:Parameter Name="CFID" Type="Int32" />
                            <asp:Parameter Name="OPERATOR" Type="String" />
                            <asp:Parameter Name="DATE" Type="DateTime" />
                            <asp:Parameter Name="COMMENT" Type="String" />
                        </InsertParameters>
                        <SelectParameters>
                            <asp:ControlParameter ControlID="CFID" Name="CFID" PropertyName="Text" 
                                Type="Int32" />
                        </SelectParameters>
                        <UpdateParameters>
                            <asp:Parameter Name="DATE" Type="DateTime" />
                            <asp:Parameter Name="COMMENT" Type="String" />
                            <asp:Parameter Name="ID" Type="Int32" />
                        </UpdateParameters>
                    </asp:SqlDataSource>

                                        <asp:GridView ID="GridView4" runat="server" CssClass="mGrid" 
                        PagerStyle-CssClass="pgr" AlternatingRowStyle-CssClass="alt" 
                        DataSourceID="SqlDataSource8" AutoGenerateColumns="False" 
                        CommandRowStyle-Font-Size="11"   CommandRowStyle-ForeColor="red"
                        DataKeyNames="ID"  ShowFooter="false" ShowHeader="false"
                        EnableModelValidation="True">
                        <AlternatingRowStyle CssClass="alt"></AlternatingRowStyle>


                        <Columns>

                            <asp:TemplateField HeaderText="ID" InsertVisible="False" SortExpression="ID" Visible="false">
                                <ItemTemplate>
                                    <asp:Label ID="Label1" runat="server" Text='<%# Bind("ID") %>'></asp:Label>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:Label ID="Label1" runat="server" Text='<%# Eval("ID") %>'></asp:Label>
                                </EditItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="CFID" SortExpression="CFID" Visible="false">
                                <ItemTemplate>
                                    <asp:Label ID="Label2" runat="server" Text='<%# Bind("CFID") %>'></asp:Label>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("CFID") %>'></asp:TextBox>
                                </EditItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="OPERATOR" SortExpression="OPERATOR">
                                <ItemTemplate>
                                    <asp:Label ID="Label3" runat="server" Text='<%# Bind("OPERATOR") %>'></asp:Label>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:TextBox ID="OPERATOR" runat="server" Text='<%# Bind("OPERATOR") %>'  ReadOnly="true"></asp:TextBox>
                                </EditItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="DATE" SortExpression="DATE">
                                <ItemTemplate>
                                    <asp:Label ID="Label4" runat="server" Text='<%# Bind("DATE") %>'></asp:Label>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("DATE") %>' ReadOnly="true"></asp:TextBox>
                                </EditItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="COMMENT" SortExpression="COMMENT">
                                <ItemTemplate>
                                    <asp:Label ID="Label5" runat="server" Text='<%# Bind("COMMENT") %>'></asp:Label>
                                </ItemTemplate>
                                <EditItemTemplate>

                                    <asp:TextBox ID="COMMENT" Rows="5" cols="40" Width="600px" runat="server" TextMode="MultiLine"
                                        Text='<%# Bind("COMMENT") %>'></asp:TextBox>
                                    
                                </EditItemTemplate>
                            </asp:TemplateField>

                            <asp:TemplateField ShowHeader="False">
                                <EditItemTemplate>
                                    <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="True" 
                                        CommandName="Update" Text="Update" Font-Size="14px"></asp:LinkButton>
                                    &nbsp;<asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" 
                                        CommandName="Cancel" Text="Cancel" Font-Size="14px"></asp:LinkButton>
                                </EditItemTemplate>
                                <ItemTemplate>
                                    <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" 
                                        CommandName="Edit" Text="Edit" Font-Size="14px"></asp:LinkButton>
                                    &nbsp;

                                </ItemTemplate>

                            </asp:TemplateField>
                            <asp:TemplateField ShowHeader="False">
                                <ItemTemplate>
                                    <asp:LinkButton ID="LinkButton3" runat="server" CausesValidation="False"  Font-Size="14px"
                                        CommandName="Delete" Text="Delete" OnClientClick="return confirm('Are You Sure to Delete?')"></asp:LinkButton>
  
                                </ItemTemplate>
                            </asp:TemplateField>


                        </Columns>
                                            <PagerStyle CssClass="pgr" />
                    </asp:GridView>

                                        <asp:Label ID="CaseLabelnew" runat="server" Text='<%# Eval("CFID") %>' Visible="false"/>
                                        <asp:Button ID="LinkButtonAddNewComment" runat="server" Text="Add New Comment" onclick="AddNewCommentOnClick" 
                                        CommandArgument='<%# Eval("CFID") %>' ></asp:Button>
                                    </EditItemTemplate>

                                    <ItemTemplate>



                                    </ItemTemplate>
                                    <InsertItemTemplate>
                                    </InsertItemTemplate>

                                </asp:TemplateField>



                <asp:TemplateField HeaderText="File Record">
                    <ItemTemplate>


                    </ItemTemplate>
                    <InsertItemTemplate>
                    </InsertItemTemplate>
                    <EditItemTemplate>

                        
                        <asp:Label ID="CFIDLabel" runat="server" Text='<%# Eval("CFID") %>' visible="false"/>

                        <asp:SqlDataSource ID="SqlDataSource17" runat="server" 
                        ConnectionString="<%$ ConnectionStrings:SQLServer2005DBConnectionString %>" 
                        DeleteCommand="DELETE FROM [tblFeedback_Case_File] WHERE [ID] = @ID" 
                        InsertCommand="INSERT INTO [tblFeedback_Case_File] ([DATE], [CASEID], [NAME], [SIZE], [DATA]) VALUES (@DATE, @CASEID, @NAME, @SIZE, @DATA)" 
                        SelectCommand="SELECT * FROM [tblFeedback_Case_File] WHERE ([CASEID] = @CASEID)" 
                        
                        
                        UpdateCommand="UPDATE [tblFeedback_Case_File] SET [DATE] = @DATE, [CASEID] = @CASEID, [NAME] = @NAME, [SIZE] = @SIZE, [DATA] = @DATA WHERE [ID] = @ID">
                            <DeleteParameters>
                                <asp:Parameter Name="ID" Type="Int32" />
                            </DeleteParameters>
                            <InsertParameters>
                                <asp:Parameter Name="DATE" Type="DateTime" />
                                <asp:Parameter Name="CASEID" Type="Int32" />
                                <asp:Parameter Name="NAME" Type="String" />
                                <asp:Parameter Name="SIZE" Type="Int64" />
                                <asp:Parameter Name="DATA" Type="Object" />
                            </InsertParameters>
                            <SelectParameters>
                                <asp:ControlParameter ControlID="CFIDLabel" Name="CASEID" PropertyName="Text" 
                                    Type="Int32" />
                            </SelectParameters>
                            <UpdateParameters>
                                <asp:Parameter Name="DATE" Type="DateTime" />
                                <asp:Parameter Name="CASEID" Type="Int32" />
                                <asp:Parameter Name="NAME" Type="String" />
                                <asp:Parameter Name="SIZE" Type="Int64" />
                                <asp:Parameter Name="DATA" Type="Object" />
                                <asp:Parameter Name="ID" Type="Int32" />
                            </UpdateParameters>
                    </asp:SqlDataSource>

                        <asp:GridView ID="GridView5" runat="server" CssClass="mGrid" 
                        PagerStyle-CssClass="pgr" AlternatingRowStyle-CssClass="alt" 
                        DataSourceID="SqlDataSource17" AutoGenerateColumns="False" 
                        DataKeyNames="ID" ShowFooter="false" ShowHeader="false"
                        EnableModelValidation="True" AllowSorting="True">
                        <AlternatingRowStyle CssClass="alt"></AlternatingRowStyle>



                            <Columns>
                                
                                 <asp:TemplateField HeaderText="File Name" SortExpression="NAME">
                                    <EditItemTemplate>
                                        <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("NAME") %>'></asp:TextBox>
                                    </EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:Label ID="Label4" runat="server" Text='<%# Bind("NAME") %>'></asp:Label>
                                    </ItemTemplate>

                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="ID" InsertVisible="False" SortExpression="ID" Visible="false">
                                    <EditItemTemplate>
                                        <asp:Label ID="Label1" runat="server" Text='<%# Eval("ID") %>'></asp:Label>
                                    </EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:Label ID="Label1" runat="server" Text='<%# Bind("ID") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Upload Date" SortExpression="DATE">
                                    <EditItemTemplate>
                                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("DATE") %>'></asp:TextBox>
                                    </EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:Label ID="Label2" runat="server" Text='<%# Bind("DATE") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="CASEID" SortExpression="CASEID" Visible="false">
                                    <EditItemTemplate>
                                        <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("CASEID") %>'></asp:TextBox>
                                    </EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:Label ID="Label3" runat="server" Text='<%# Bind("CASEID") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                               
                                <asp:TemplateField HeaderText="File Size" SortExpression="SIZE">
                                    <EditItemTemplate>
                                        <asp:TextBox ID="TextBox4" runat="server" Text='<%# Bind("SIZE") %>'></asp:TextBox>
                                    </EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:Label ID="Label5" runat="server" Text='<%# Bind("SIZE") %>'></asp:Label>
                                    </ItemTemplate>
                                    
                                </asp:TemplateField>

                                <asp:TemplateField>
                                    <ItemTemplate>
                                        <asp:HyperLink ID="HyperLink1" runat="server"
                                            NavigateUrl='<%# Eval("ID", "GetFile.aspx?ID={0}") %>'
                                            Text="Download" Font-Size="14px"></asp:HyperLink>

                                        <asp:LinkButton ID="LinkButtonDelete2" runat="server" CausesValidation="False"  Font-Size="14px"
                                            CommandName="Delete" Text="Delete" OnClientClick="return confirm('Are You Sure to Delete?')"></asp:LinkButton>

                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                            <PagerStyle CssClass="pgr" />
                        </asp:GridView>




                        <input type="file" name="fileInput" />
                        <asp:Button ID="btnUpload" Text="Upload File Attachment" runat="server"
                                             OnClick="btnUpload_Click" CommandArgument='<%# Eval("CFID") %>' />




                    </EditItemTemplate>

                </asp:TemplateField>
                
                <asp:TemplateField HeaderText="Operation history">
                    <EditItemTemplate>

                    </EditItemTemplate>
                    <InsertItemTemplate>
                        
                    </InsertItemTemplate>
                    <ItemTemplate>

                    </ItemTemplate>
                </asp:TemplateField>

            </Fields>

<PagerStyle CssClass="pgr"></PagerStyle>
        </asp:DetailsView>



    </div>
    </form>
</body>
<script src="http://ajax.microsoft.com/ajax/jquery/jquery-1.4.2.min.js" type="text/javascript"></script>
<script src="ticket.js" type="text/javascript"></script>
</html>
